From abcb132d62052db8c7e4546408d538a1c6d507e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 20 Aug 2024 07:57:17 +0300 Subject: [PATCH] ci: run main tests on macOS and Windows, too --- .github/workflows/check.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2abc2bd..42f993e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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