-
Notifications
You must be signed in to change notification settings - Fork 10
55 lines (53 loc) · 1.64 KB
/
ci-pre-commit.yml
File metadata and controls
55 lines (53 loc) · 1.64 KB
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
46
47
48
49
50
51
52
53
54
55
name: Pre-commit checks
on:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Need to grab the history of the PR
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
registry-url: "https://registry.npmjs.org"
- uses: ./.github/actions/python-poetry
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.85.1
components: clippy
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2024-12-03
components: rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "28.x"
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev pkg-config
- name: Install Anchor CLI
run: |
cargo install --git https://github.com/coral-xyz/anchor avm
avm install 0.31.0
avm use 0.31.0
echo "$HOME/.avm/bin" >> $GITHUB_PATH
- uses: pre-commit/action@v3.0.0
if: ${{ github.event_name == 'pull_request' }}
with:
# Run only on files changed in the PR
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
- uses: pre-commit/action@v3.0.0
if: ${{ github.event_name != 'pull_request' }}