Skip to content

Revert "TO-DROP: ci: reuse windows-artifacts from an earlier run" #1594

Revert "TO-DROP: ci: reuse windows-artifacts from an earlier run"

Revert "TO-DROP: ci: reuse windows-artifacts from an earlier run" #1594

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-build:
name: win build
runs-on: windows-latest
concurrency:
group: windows-build-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: replace the MSYS2 runtime
shell: powershell
run: |
Invoke-WebRequest -Headers @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } "https://api.github.com/repos/msys2/msys2-runtime/actions/artifacts/1082027388/zip" -outfile "a1.zip"
Expand-Archive -Force -DestinationPath D:/git-sdk-64-minimal a1.zip
Remove-Item a1.zip
- name: build
shell: bash
env:
HOME: ${{runner.workspace}}
NO_PERL: 1
run: uname -a && . /etc/profile && ci/make-test-artifacts.sh artifacts
- name: zip up tracked files
run: git archive -o artifacts/tracked.tar.gz HEAD
- name: upload tracked files and build artifacts
uses: actions/upload-artifact@v3
with:
name: windows-artifacts
path: artifacts
windows-test:
name: win test
runs-on: windows-latest
needs: [windows-build]
strategy:
fail-fast: false
matrix:
n:
- nr: "½"
run: 7241848078
concurrency:
group: windows-test-${{ matrix.n.nr }}-${{ github.ref }}
steps:
- name: download tracked files and build artifacts
uses: actions/download-artifact@v3
with:
name: windows-artifacts
path: ${{github.workspace}}
- name: extract tracked files and build artifacts
shell: bash
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
- name: do use current versions of a couple of files
shell: bash
run: |
# these have changed since the run whose artifacts we're reusing
for p in ci/lib.sh ci/run-test-slice.sh t/Makefile t/t3100-ls-tree-restrict.sh
do
curl -Lo $p ${{ github.server_url }}/${{ github.repository }}/raw/${{ github.sha }}/$p ||
exit 1
done
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: replace the MSYS2 runtime
shell: powershell
run: |
$headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" }
$run_url = "https://api.github.com/repos/dscho/Cygwin-msys2-fork/actions/runs/${{ matrix.n.run }}/artifacts"
$run = ((Invoke-WebRequest -Headers $headers $run_url).content | ConvertFrom-JSON)
$zip_url = $run.artifacts.archive_download_url
Invoke-WebRequest -Headers $headers $zip_url -outfile "install.zip"
Expand-Archive -Force -DestinationPath D:/git-sdk-64-minimal install.zip
Remove-Item install.zip
- name: test
id: test
shell: bash
timeout-minutes: 240
run: . /etc/profile && env >/tmp/env.txt && set >/tmp/set.txt && 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() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v3
with:
name: failed-tests-windows
path: ${{env.FAILED_TEST_ARTIFACTS}}