Add msys2 option #136
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
name: Test cache | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test-cache: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-12 | |
- macos-14 | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
config: | |
- version: '2.0.2' | |
branch: '' | |
- version: '1.2.2' | |
branch: '' | |
- version: 'nightly' | |
branch: '' | |
- version: '' | |
branch: 'master' | |
# Exclude combos that do not make sense (we dont have aarm64 for 1.2.2) | |
exclude: | |
- os: macos-14 | |
config: {version: '1.2.2', branch: ''} | |
- os: macos-latest | |
config: {version: '1.2.2', branch: ''} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# This might hit cache | |
- name: Check action itself (attempt 1) | |
id: attempt_1 | |
uses: ./ | |
with: | |
version: ${{matrix.config.version}} | |
branch: ${{matrix.config.branch}} | |
msys2: false | |
# Not needed, speed up test. This is tested in selftest.yml | |
# Next attemp should hit cache given the previous run | |
- name: Check action itself (attempt 2) | |
if: steps.attempt_1.outputs.cache_hit != 'true' | |
id: attempt_2 | |
uses: ./ | |
with: | |
version: ${{matrix.config.version}} | |
branch: ${{matrix.config.branch}} | |
msys2: false | |
- name: Diagnose cache use | |
shell: bash | |
run: | | |
echo "Caching attempt 1: ${{steps.attempt_1.outputs.cache_hit}}" | |
echo "Caching attempt 2: ${{steps.attempt_2.outputs.cache_hit}}" | |
# Fail if no cache was hit | |
- if: (steps.attempt_1.outputs.cache_hit != 'true') && (steps.attempt_2.outputs.cache_hit != 'true') | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('FAIL: No cache hit observed') | |
# Check alr and default toolchains | |
- run: alr -n version | |
- run: | | |
alr -n init --bin alrws | |
cd alrws | |
alr exec -- gnat --version | |
alr exec -- gprbuild --version | |
# Verify proper builds | |
- run: alr -n version | grep "os:" | grep LINUX | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
- run: alr -n version | grep "os:" | grep MACOS | |
if: matrix.os == 'macos-latest' | |
shell: bash | |
- run: alr -n version | grep "os:" | grep WINDOWS | |
if: matrix.os == 'windows-latest' | |
shell: bash |