Skip to content

Commit 42abdc7

Browse files
committed
Add ci
1 parent f26226f commit 42abdc7

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

src/.github/workflows/ci-pre-commit.yml

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,27 @@ on:
88
jobs:
99
pre-commit:
1010
runs-on: ubuntu-latest
11+
1112
steps:
1213
- uses: actions/checkout@v3
1314
with:
1415
# Need to grab the history of the PR
1516
fetch-depth: 0
16-
- uses: actions/setup-node@v4
17-
with:
18-
node-version-file: "package.json"
19-
registry-url: "https://registry.npmjs.org"
20-
- uses: ./.github/actions/python-poetry
21-
- uses: actions-rs/toolchain@v1
22-
with:
23-
profile: minimal
24-
toolchain: 1.85.1
25-
components: clippy
26-
- uses: actions-rs/toolchain@v1
27-
with:
28-
profile: minimal
29-
toolchain: nightly-2024-12-03
30-
components: rustfmt
31-
- name: Install Protoc
32-
uses: arduino/setup-protoc@v3
33-
with:
34-
version: "28.x"
35-
- uses: pnpm/action-setup@v4
36-
name: Install pnpm
17+
18+
- name: Set up Python (for pre-commit)
19+
uses: actions/setup-python@v5
3720
with:
38-
run_install: true
39-
- name: Install Anchor CLI
40-
run: |
41-
cargo install --git https://github.com/coral-xyz/anchor avm
42-
avm install 0.31.0
43-
avm use 0.31.0
44-
- uses: pre-commit/[email protected]
21+
python-version: '3.x'
22+
23+
- name: Install pre-commit
24+
run: pip install pre-commit
25+
26+
- name: Run pre-commit on PR diff
4527
if: ${{ github.event_name == 'pull_request' }}
46-
with:
47-
# Run only on files changed in the PR
48-
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
49-
- uses: pre-commit/[email protected]
28+
run: |
29+
pre-commit run --from-ref "${{ github.event.pull_request.base.sha }}" \
30+
--to-ref "${{ github.event.pull_request.head.sha }}"
31+
32+
- name: Run pre-commit on all files (non-PR pushes)
5033
if: ${{ github.event_name != 'pull_request' }}
34+
run: pre-commit run --all-files

0 commit comments

Comments
 (0)