Skip to content

Commit

Permalink
ci: run main tests on macOS, too
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Aug 20, 2024
1 parent 66dc3ee commit 6bb8ee5
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,29 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
# No caching as we're expected to run rarely
- name: Install dependencies and run checks
shell: bash
run: |
set -euxo pipefail
python3 -m venv venv
source venv/bin/activate
python3 -m pip install pre-commit
export PRE_COMMIT_COLOR=always
pre-commit try-repo . --files .github/workflows/test-good.sh
for hook in shfmt shfmt-docker; do
shfmt_docker=$(type docker &>/dev/null && echo shfmt-docker || :)
for hook in shfmt shfmt-src $shfmt_docker; do
pre-commit try-repo . $hook --files .github/workflows/test-good.sh
done
for hook in shfmt $shfmt_docker; do
! pre-commit try-repo . $hook --files .github/workflows/test-bad.sh
! git diff --exit-code .github/workflows/test-bad.sh
git restore .github/workflows/test-bad.sh
done
env:
FORCE_COLOR: true
PRE_COMMIT_COLOR: always

0 comments on commit 6bb8ee5

Please sign in to comment.