1- name : " libp2p hole-punch interop test"
1+ name : " libp2p hole-punch interop test (self hosted) "
22description : " Run the libp2p hole-punch interoperability test suite"
33inputs :
44 test-filter :
99 description : " Exclude tests from the created matrix that include this string in their name"
1010 required : false
1111 default : " "
12+ upload-results :
13+ description : " Upload the test results as an artifact"
14+ required : false
15+ default : " true"
1216 extra-versions :
1317 description : " Space-separated paths to JSON files describing additional images"
1418 required : false
@@ -33,6 +37,10 @@ inputs:
3337 description : " How many workers to use for the test"
3438 required : false
3539 default : " 2"
40+ cache-dir :
41+ description : " Local directory to use for build cache"
42+ required : false
43+ default : " /srv/cache"
3644runs :
3745 using : " composite"
3846 steps :
5260
5361 - uses : actions/setup-node@v4
5462 with :
55- node-version : lts/*
63+ node-version : 20
5664
5765 # Existence of /etc/buildkit/buildkitd.toml indicates that this is a
5866 # self-hosted runner. If so, we need to pass the config to the buildx
7583
7684 - name : Set up Docker Buildx
7785 id : buildx
78- uses : docker/setup-buildx-action@v2
86+ uses : docker/setup-buildx-action@v3
7987 with :
8088 config : ${{ steps.buildkit.outputs.config }}
89+ version : v0.29.1
90+ driver-opts : image=moby/buildkit:v0.25.2
91+
92+ - name : Create cache directories
93+ run : |
94+ mkdir -p ${{ inputs.cache-dir }}/buildCache
95+ mkdir -p ${{ inputs.cache-dir }}/imageCache
96+ shell : bash
8197
8298 - name : Install deps
8399 working-directory : ${{ steps.find-workdir.outputs.WORK_DIR }}
@@ -87,11 +103,11 @@ runs:
87103 - name : Load cache and build
88104 working-directory : ${{ steps.find-workdir.outputs.WORK_DIR }}
89105 env :
90- AWS_BUCKET : ${{ inputs.s3- cache-bucket }}
91- AWS_REGION : ${{ inputs.aws-region }}
92- AWS_ACCESS_KEY_ID : ${{ inputs.s3-access-key-id }}
93- AWS_SECRET_ACCESS_KEY : ${{ inputs.s3-secret-access-key }}
94- run : npm run cache -- load
106+ CACHE_DIR : ${{ inputs.cache-dir }}
107+ NAME_FILER : ${{ inputs.test-filter }}
108+ NAME_IGNORE : ${{ inputs.test-ignore }}
109+ VERBOSE : ${{ inputs.verbose }}
110+ run : npm run cache -- load --name-filter="$NAME_FILTER" --name-ignore="$NAME_IGNORE" --verbose="$VERBOSE"
95111 shell : bash
96112
97113 - name : Assert Git tree is clean.
@@ -108,11 +124,11 @@ runs:
108124 if : env.PUSH_CACHE == 'true'
109125 working-directory : ${{ steps.find-workdir.outputs.WORK_DIR }}
110126 env :
111- AWS_BUCKET : ${{ inputs.s3- cache-bucket }}
112- AWS_REGION : ${{ inputs.aws-region }}
113- AWS_ACCESS_KEY_ID : ${{ inputs.s3-access-key-id }}
114- AWS_SECRET_ACCESS_KEY : ${{ inputs.s3-secret-access-key }}
115- run : npm run cache -- push
127+ CACHE_DIR : ${{ inputs.cache-dir }}
128+ NAME_FILTER : ${{ inputs.test-filter }}
129+ NAME_IGNORE : ${{ inputs.test-ignore }}
130+ VERBOSE : ${{ inputs.verbose }}
131+ run : npm run cache -- push --name-filter="$NAME_FILTER" --name-ignore="$NAME_IGNORE" --verbose="$VERBOSE"
116132 shell : bash
117133
118134 - name : Run the test
@@ -122,7 +138,9 @@ runs:
122138 EXTRA_VERSION : ${{ inputs.extra-versions }}
123139 NAME_FILTER : ${{ inputs.test-filter }}
124140 NAME_IGNORE : ${{ inputs.test-ignore }}
125- run : npm run test -- --extra-version=$EXTRA_VERSION --name-filter=$NAME_FILTER --name-ignore=$NAME_IGNORE
141+ TIMEOUT : ${{ inputs.timeout }}
142+ VERBOSE : ${{ inputs.verbose }}
143+ run : npm run test -- --extra-version=$EXTRA_VERSION --name-filter=$NAME_FILTER --name-ignore=$NAME_IGNORE --verbose=$VERBOSE
126144 shell : bash
127145
128146 - name : Print the results
@@ -140,18 +158,9 @@ runs:
140158 run : cat ./dashboard.md >> $GITHUB_STEP_SUMMARY
141159 shell : bash
142160
143- - name : Exit with Error
144- working-directory : ${{ steps.find-workdir.outputs.WORK_DIR }}
145- run : |
146- if grep -q ":red_circle:" ./dashboard.md; then
147- exit 1
148- else
149- exit 0
150- fi
151- shell : bash
152-
153- - uses : actions/upload-artifact@v4
154- if : ${{ always() }}
161+ - name : Upload test results
162+ if : ${{ always() && inputs.upload-results == 'true' }}
163+ uses : actions/upload-artifact@v4
155164 with :
156165 name : test-plans-output
157166 path : |
0 commit comments