Skip to content

Commit

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

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-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
Expand Down

0 comments on commit abcb132

Please sign in to comment.