-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.18 KB
/
rust.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
on:
pull_request:
push:
branches:
- main
name: Check, Test, and Format
jobs:
fmt:
runs-on: ['memory:8GB']
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install devenv
run: |
if [ -e /nix/var/nix/profiles/default/bin/nix-env ]
then
/nix/var/nix/profiles/default/bin/nix-env -if https://github.com/cachix/devenv/tarball/latest
else
nix-env -if https://github.com/cachix/devenv/tarball/latest
fi
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH
- name: Run cargo test
shell: devenv shell bash -- -e {0}
run: cargo fmt --all -- --check #
check:
name: Check
runs-on: ['memory:8GB']
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install devenv
run: |
if [ -e /nix/var/nix/profiles/default/bin/nix-env ]
then
/nix/var/nix/profiles/default/bin/nix-env -if https://github.com/cachix/devenv/tarball/latest
else
nix-env -if https://github.com/cachix/devenv/tarball/latest
fi
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH
- name: Run cargo check
shell: devenv shell bash -- -e {0}
run: cargo check --tests
test:
name: Test Suite
runs-on: ['nix-128g']
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Generate a random port number
run: echo PGSQL_PORT=$(shuf -i 5000-30000 -n1) > .env
- name: Install foundry
shell: devenv shell bash -- -e {0}
run: cargo install --root ${HOME}/.cargo --git https://github.com/foundry-rs/foundry --rev c4a984f forge anvil
- name: Put cargo in PATH
shell: devenv shell bash -- -e {0}
run: echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
- name: Run cargo test
run: devenv test
env:
RUST_LOG: "info"
RUST_MIN_STACK: 10485760
CI_RPC_URL: ${{ secrets.CI_RPC_URL }}
CI_SEPOLIA: ${{ secrets.CI_SEPOLIA }}
CI_ETH: ${{ secrets.CI_ETH }}
LPN_PARAMS_DIR: $HOME/ci_params/
LPN_PARAMS_REBUILD: "true"