fix: CI only runs on ubuntu (#5) #93
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 Action | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
test-save: | |
name: "Test save on ${{ matrix.os }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test Save | |
uses: ./save | |
with: | |
path: .github/ | |
# Create a unique key to test intra workflow artifacts. | |
key: test/stash-${{ matrix.os }}-${{ github.sha }} | |
retention-days: '1' | |
- name: Test Overwrite | |
id: test | |
uses: ./save | |
with: | |
path: .github/ | |
# Create a unique key to test intra workflow artifacts. | |
key: test/stash-${{ matrix.os }}-${{ github.sha }} | |
retention-days: '1' | |
- name: Check Output | |
shell: bash | |
env: | |
ID: ${{ steps.test.outputs.stash-id }} | |
URL: ${{ steps.test.outputs.stash-url }} | |
run: | | |
if [ -z "$ID" -o -z "$URL" ]; then | |
echo "Output empty" | |
exit 1 | |
fi | |
- name: Check if inter-workflow stash exists | |
id: stash | |
uses: ./restore | |
with: | |
key: test-stash-cross-${{ matrix.os }} | |
path: test-stash | |
- name: Save cross-workflow Stash | |
if: ${{ steps.stash.outputs.stash-hit == 'false' }} | |
uses: ./save | |
with: | |
path: .github/ | |
key: test-stash-cross-${{ matrix.os }} | |
retention-days: '90' | |
test-restore: | |
name: "Test restore on ${{ matrix.os }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
needs: test-save | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test intra-workflow stash | |
uses: ./restore | |
with: | |
key: test/stash-${{ matrix.os }}-${{ github.sha }} | |
path: intra/.github/ | |
- shell: bash | |
run: ls -laR intra | |
- name: Test inter-workflow stash | |
uses: ./restore | |
with: | |
key: test-stash-cross-${{ matrix.os }} | |
path: inter/.github/ | |
- shell: bash | |
run: ls -laR inter/ |