-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (55 loc) · 2.17 KB
/
ci-pre-commit.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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: ./.github/actions/python-poetry
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2023-03-01
components: rustfmt, clippy
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2024-04-10
components: rustfmt, clippy
- name: Install Foundry
uses: foundry-rs/[email protected]
with:
version: nightly
- name: Install npm dependencies
working-directory: contracts/evm
run: npm install
- name: Install forge dependencies 1
working-directory: contracts/evm
run: forge install foundry-rs/[email protected] --no-git --no-commit
- name: Install forge dependencies 2
working-directory: contracts/evm
run: forge install OpenZeppelin/[email protected] --no-git --no-commit
- name: Install forge dependencies 3
working-directory: contracts/evm
run: forge install OpenZeppelin/[email protected] --no-git --no-commit
- name: Install forge dependencies 4
working-directory: contracts/evm
run: forge install Uniswap/permit2@0x000000000022D473030F116dDEE9F6B43aC78BA3 --no-git --no-commit
- name: Install forge dependencies 5
working-directory: contracts/evm
run: forge install nomad-xyz/ExcessivelySafeCall@be417ab0c26233578b8d8f3a37b87bd1fcb4e286 --no-git --no-commit
- name: Install Anchor CLI
run: npm install -g @coral-xyz/[email protected]
- uses: pre-commit/[email protected]
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/[email protected]
if: ${{ github.event_name != 'pull_request' }}