-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (38 loc) · 1.23 KB
/
ci.yaml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: CI
####################################
# Start the job on all push and PR #
####################################
on:
pull_request:
branches: [master, main]
types: [synchronize, opened, reopened, ready_for_review]
# push:
# branches: [master, main]
jobs:
precommits:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install pre-commit
pre-commit install
- name: Install shfmt
run: |
SHFMT_VERSION="v3.7.0"
SHFMT_BIN="shfmt_${SHFMT_VERSION}_linux_amd64"
wget -O shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/${SHFMT_BIN}"
chmod +x shfmt
sudo mv shfmt /usr/local/bin/
- name: Run pre-commits
run: |
# pre-commit run --all-files
pre-commit run --from-ref ${{ env.BASE_COMMIT_ID }} --to-ref $(git log --pretty=tformat:"%H" -n1 .)
# pre-commit run --from-ref origin/main --to-ref HEAD
# run: |
# BASE_COMMIT_ID=$(git rev-parse origin/main)