Skip to content

Commit 0996aac

Browse files
committed
ci: run main tests on macOS, too
1 parent 09cbf7c commit 0996aac

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/check.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,26 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [macos-latest, ubuntu-latest]
1215
steps:
1316
- uses: actions/checkout@v4
1417
# No caching as we're expected to run rarely
1518
- name: Install dependencies and run checks
19+
shell: bash
1620
run: |
1721
set -euxo pipefail
22+
python3 -m venv venv
23+
source venv/bin/activate
1824
python3 -m pip install pre-commit
1925
export PRE_COMMIT_COLOR=always
20-
pre-commit try-repo . --files .github/workflows/test-good.sh
21-
for hook in shfmt shfmt-docker; do
26+
shfmt_docker=$(type docker &>/dev/null && echo shfmt-docker || :)
27+
for hook in shfmt shfmt-src $shfmt_docker; do
28+
pre-commit try-repo . $hook --files .github/workflows/test-good.sh
29+
done
30+
for hook in shfmt $shfmt_docker; do
2231
! pre-commit try-repo . $hook --files .github/workflows/test-bad.sh
2332
! git diff --exit-code .github/workflows/test-bad.sh
2433
git restore .github/workflows/test-bad.sh

0 commit comments

Comments
 (0)