Repository navigation
110 lines (86 loc) · 2.84 KB
/
Copy pathci.yml
File metadata and controls
110 lines (86 loc) · 2.84 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
"on":
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
pull-requests: read
env:
# CI never touches live services. Everything runs against the sandbox on recorded fixtures.
RECOURSE_MODE: sandbox
jobs:
contract:
name: Contract — build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Immutable commit SHA corresponding to dtolnay/rust-toolchain v1 release tag
- name: Install Rust (1.95.0)
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: "1.95.0"
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Unit tests
run: cargo test --manifest-path contracts/recourse/Cargo.toml --lib
- name: Invariant property tests
run: cargo test --manifest-path contracts/recourse/Cargo.toml --test invariants
- name: Build wasm
run: cargo build --manifest-path contracts/recourse/Cargo.toml --target wasm32-unknown-unknown --release
typescript:
name: TypeScript — typecheck, lint, test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test:services
judge:
name: Judge script
runs-on: ubuntu-latest
needs: [contract, typescript]
steps:
- uses: actions/checkout@v4
# Immutable commit SHA corresponding to dtolnay/rust-toolchain v1 release tag
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: "1.95.0"
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
# The headline check: a fresh clone, no keys, 7/7 PASS and solvency OK.
- name: npm run judge
run: npm run judge
secrets:
name: No secrets in repo or history
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}