Stop using actions/download-artifact and actions/upload-artifact #903
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
bootstrap: | |
runs-on: macos-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch the whole Git history | |
- run: ./bootstrap.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bootstrapped | |
path: jou_bootstrap | |
test: | |
needs: bootstrap | |
runs-on: macos-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
llvm-version: [14, 15, 16] | |
# Testing all levels because there was a bug that only happened with -O1. (#224) | |
opt-level: ['-O0', '-O1', '-O2', '-O3'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Download bootstrap compiler artifact" | |
run: | | |
url="$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" | tee /dev/stderr | jq -r '.artifacts[] | select(.name == "bootstrapped") | .archive_download_url')" | |
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o artifact.zip "$url" | |
unzip artifact.zip | |
rm -v artifact.zip | |
touch jou_bootstrap # Do not use modification timestamp extracted from zip | |
- run: chmod +x jou_bootstrap | |
- run: brew install bash diffutils llvm@${{ matrix.llvm-version }} | |
- name: "Select LLVM version" | |
run: echo "LLVM_CONFIG=/opt/homebrew/opt/llvm@${{ matrix.llvm-version }}/bin/llvm-config" >> $GITHUB_ENV | |
- name: "Compile and test" | |
run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }}" | |
- name: "Compile the compiler with itself" | |
run: mv jou jou_bootstrap && make | |
- name: "Compile and test again" | |
run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }}" | |
doctest: | |
needs: bootstrap | |
runs-on: macos-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Download bootstrap compiler artifact" | |
run: | | |
url="$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" | tee /dev/stderr | jq -r '.artifacts[] | select(.name == "bootstrapped") | .archive_download_url')" | |
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o artifact.zip "$url" | |
unzip artifact.zip | |
rm -v artifact.zip | |
touch jou_bootstrap # Do not use modification timestamp extracted from zip | |
- run: chmod +x jou_bootstrap | |
- run: brew install bash diffutils llvm@15 | |
- run: ./doctest.sh |