Skip to content

Commit aa56c62

Browse files
committed
ci: add cross-platform unit test matrix and fix FOSSA skip
- Add ubuntu, macos, windows to unit test matrix (#25) - FOSSA: gracefully skip all steps when FOSSA_API_KEY is not configured Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 3e67576 commit aa56c62

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ concurrency:
1414

1515
jobs:
1616
unit-test:
17-
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
runs-on: ${{ matrix.os }}
1821
timeout-minutes: 10
1922
steps:
2023
- name: Checkout

.github/workflows/fossa.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,33 @@ concurrency:
1616
jobs:
1717
fossa:
1818
name: License compliance
19-
if: secrets.FOSSA_API_KEY != ''
2019
env:
2120
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
2221
runs-on: ubuntu-latest
2322
timeout-minutes: 10
2423
steps:
24+
- name: Check API key
25+
id: check
26+
run: |
27+
if [ -z "$FOSSA_API_KEY" ]; then
28+
echo "skip=true" >> "$GITHUB_OUTPUT"
29+
echo "FOSSA_API_KEY not configured, skipping"
30+
fi
31+
2532
- name: Checkout
33+
if: steps.check.outputs.skip != 'true'
2634
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2735
with:
2836
persist-credentials: false
2937

3038
- name: Run FOSSA analysis
39+
if: steps.check.outputs.skip != 'true'
3140
uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # v1
3241
with:
3342
api-key: ${{ secrets.FOSSA_API_KEY }}
3443

3544
- name: Run FOSSA test
45+
if: steps.check.outputs.skip != 'true'
3646
uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # v1
3747
with:
3848
api-key: ${{ secrets.FOSSA_API_KEY }}

0 commit comments

Comments
 (0)