-
Notifications
You must be signed in to change notification settings - Fork 6
31 lines (29 loc) · 908 Bytes
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Main push and PR checks
on:
pull_request:
push:
branches:
- main
jobs:
test:
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
! 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