88
99jobs :
1010 build_and_test :
11- runs-on : ubuntu-22.04
12- needs : get_refs
11+ runs-on : ubuntu-latest
12+ needs : get_ref
1313 strategy :
1414 fail-fast : false
1515 matrix :
@@ -18,21 +18,21 @@ jobs:
1818 # to major version bump the library
1919 version : [14, 16, 18, 20]
2020 steps :
21- - uses : actions/checkout@v3
22- - uses : actions/setup-node@v3
21+ - uses : actions/checkout@v5
22+ - uses : actions/setup-node@v6
2323 with :
2424 node-version : ${{ matrix.version }}
2525 - name : build and unit test
2626 run : yarn && yarn build
2727 - name : clone the tsp
28- uses : actions/checkout@v3
28+ uses : actions/checkout@v5
2929 with :
3030 repository : IronCoreLabs/tenant-security-proxy
31- ref : ${{ needs.get_refs .outputs.tenant-security-proxy }}
31+ ref : ${{ needs.get_ref .outputs.tsp_ref }}
3232 path : tenant-security-proxy
3333 token : ${{ secrets.WORKFLOW_PAT }}
3434 - name : cache cargo
35- uses : actions/cache@v3
35+ uses : actions/cache@v4
3636 with :
3737 key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
3838 path : |
@@ -53,89 +53,27 @@ jobs:
5353 timeout 700 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000/ready)" =~ ''[01346-9][0-9][0-9]'' ]]; do sleep 5; done' || false
5454 env $(cat .env.integration) yarn integration
5555
56- # Look for a comment telling us what refs to use from the other repos we depend on.
57- # To add additional repositories, add them to "outputs" and to the "Setup list of required repos" step.
58- get_refs :
59- # Only run if it's on a PR.
60- if : github.base_ref != ''
61- runs-on : ubuntu-22.04
62- outputs :
63- tenant-security-proxy : ${{ steps.get_refs.outputs.tenant-security-proxy }}
64- steps :
65- - name : Setup list of required repos
66- run : |
67- echo tenant-security-proxy >> repos
68- - name : Get PR number
69- id : get_pr
70- run : |
71- PR=$(jq -r .pull_request.number "${GITHUB_EVENT_PATH}")
72- echo "PR is ${PR}"
73- # Sanity check that ${PR} is a number.
74- test "${PR}" -ge 0
75- echo "pr=${PR}" >> "$GITHUB_OUTPUT"
76- - name : Find Comment
77- uses : peter-evans/find-comment@v2
78- id : find_comment
79- with :
80- issue-number : ${{ steps.get_pr.outputs.pr }}
81- body-includes : CI_branches
82- direction : last
83- - name : Parse refs
84- if : steps.find_comment.outputs.comment-id != 0
85- id : get_refs
86- env :
87- COMMENT_BODY : ${{ steps.find_comment.outputs.comment-body }}
88- run : |
89- # Extract the JSON part of the comment into a file.
90- echo "${COMMENT_BODY}" | tr '\n' ' ' | sed -e 's,^[^{]*,,' -e 's,[^}]*$,,' > refs.json
91- echo "Got JSON:"
92- cat refs.json && echo ""
93-
94- # Sanity check that all repos in the JSON comment are ones that we know about.
95- jq -r 'keys[]' < refs.json > extra_repos
96- for REPO in $(cat repos) ; do
97- grep -v "^${REPO}\$" < extra_repos > temp || true
98- mv temp extra_repos
99- done
100- if [ -s extra_repos ] ; then
101- echo "Unrecognized repositories:"
102- cat extra_repos
103- exit 1
104- fi
105-
106- # Emit an output variable for each repo.
107- for REPO in $(cat repos) ; do
108- REF=$(jq -r '.["'"${REPO}"'"]' < refs.json)
109- if [ "${REF}" = "null" ] ; then
110- REF="main"
111- fi
112- echo "${REPO}: ${REF}"
113- echo "${REPO}=${REF}" >> "$GITHUB_OUTPUT"
114- done
115- - name : Post a reaction (parsed your comment)
116- if : steps.get_refs.outcome == 'success'
117- uses : peter-evans/create-or-update-comment@v3
118- with :
119- issue-number : ${{ steps.get_pr.outputs.pr }}
120- comment-id : ${{ steps.find_comment.outputs.comment-id }}
121- reactions : eyes
122- - name : Post a reaction (unparsed comment)
123- if : steps.get_refs.outcome == 'failure'
124- uses : peter-evans/create-or-update-comment@v3
125- with :
126- issue-number : ${{ steps.get_pr.outputs.pr }}
127- comment-id : ${{ steps.find_comment.outputs.comment-id }}
128- reactions : confused
56+ # Look for a comment telling us what TSP ref to use.
57+ get_ref :
58+ uses : IronCoreLabs/workflows/.github/workflows/get-tsp-ref.yaml@get-tsp-ref-v1
59+ secrets : inherit
12960
13061 build_examples :
131- runs-on : ubuntu-22.04
62+ runs-on : ubuntu-latest
13263 strategy :
13364 fail-fast : false
13465 matrix :
135- example-dir : [large-documents, logging-example, rekey-example, simple-roundtrip, deterministic-roundtrip]
66+ example-dir :
67+ [
68+ large-documents,
69+ logging-example,
70+ rekey-example,
71+ simple-roundtrip,
72+ deterministic-roundtrip,
73+ ]
13674 steps :
137- - uses : actions/checkout@v3
138- - uses : actions/setup-node@v3
75+ - uses : actions/checkout@v5
76+ - uses : actions/setup-node@v6
13977 with :
14078 node-version : 14
14179 - name : compilation check
0 commit comments