Skip to content

fixup! TO-DROP: ci: reuse windows-artifacts from an earlier run #1582

fixup! TO-DROP: ci: reuse windows-artifacts from an earlier run

fixup! TO-DROP: ci: reuse windows-artifacts from an earlier run #1582

Workflow file for this run

name: CI
on: [push, pull_request]
env:
DEVELOPER: 1
# If more than one workflow run is triggered for the very same commit hash
# (which happens when multiple branches pointing to the same commit), only
# the first one is allowed to run, the second will be kept in the "queued"
# state. This allows a successful completion of the first run to be reused
# in the second run via the `skip-if-redundant` logic in the `config` job.
#
# The only caveat is that if a workflow run is triggered for the same commit
# hash that another run is already being held, that latter run will be
# canceled. For more details about the `concurrency` attribute, see:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.sha }}
jobs:
windows-test:
name: win test
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
n:
- nr: 1
run: 7072653564
concurrency:
group: windows-test-${{ matrix.n.nr }}-${{ github.ref }}
steps:
- name: reuse `windows-artifacts`
shell: bash
run: |
run_id=7069719923 &&
name=windows-artifacts &&
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-L https://api.github.com/repos/${{github.repository}}/actions/runs/$run_id/artifacts |
jq -r '.artifacts[] | select(.name | test("'$name'")) | [.name, .archive_download_url] | @tsv' |
tr -d '\r' |
while read name url
do
echo "$name"
curl -H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-#sLo /tmp/"$name".zip "$url" &&
unzip -q /tmp/"$name".zip
done
- name: extract tracked files and build artifacts
shell: bash
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
- name: do use current `ci/lib.sh`
shell: bash
run: curl -Lo ci/lib.sh ${{ github.server_url }}/${{ github.repository }}/raw/${{ github.sha }}/ci/lib.sh
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: test
id: test
shell: bash
timeout-minutes: 1
run: . /etc/profile && ci/run-test-slice.sh 0 1
- name: handle timed-out tests
if: failure() && steps.test.outcome == 'failure' && env.FAILED_TEST_ARTIFACTS == ''
shell: bash
run: . /etc/profile && . ci/lib.sh && { handle_failed_tests || test $? = 1; }
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
shell: bash
run: ci/print-test-failures.sh
- name: Upload failed/timed-out tests' directories
if: failure()
uses: actions/upload-artifact@v3
with:
name: failed-tests-windows
path: ${{env.FAILED_TEST_ARTIFACTS}}