-
Notifications
You must be signed in to change notification settings - Fork 421
70 lines (59 loc) · 2.75 KB
/
Copy pathvalidate-common-scripts.yml
File metadata and controls
70 lines (59 loc) · 2.75 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
name: Validate Common Scripts
on:
pull_request:
push:
branches: [main]
# Least-privilege default: this workflow only reads the repo to build/lint.
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# base-contracts v8.2.1 — the version the active/evm shared Foundry project
# (active/evm/foundry.toml) and script/common/ are written against. Bump this
# together with the task .env pins when moving to a newer base-contracts.
BASE_CONTRACTS_COMMIT: f3a33c8577c8ca1e037b45e822bfcb75f099270b
jobs:
validate-common:
name: active/evm script/common
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# ── Toolchain (mise) ─────────────────────────────────────────────
# Installs all tools pinned in mise.toml (foundry, node, bun, go) so
# CI runs match local signer environments byte-for-byte.
- name: Install mise-managed toolchain
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
with:
experimental: true
# ── Dependencies ─────────────────────────────────────────────────
# Install Foundry deps into the shared active/evm project. PROJECT_DIR
# points forge install at active/evm; BASE_CONTRACTS_COMMIT is supplied
# via env since the shared project has no task .env of its own.
- name: Install dependencies
run: make deps PROJECT_DIR="$PWD/active/evm"
# ── Validation ───────────────────────────────────────────────────
- name: Check Solidity formatting
working-directory: active/evm
run: |
echo "==> forge fmt --check script/"
if ! forge fmt --check script/; then
echo ""
echo "::error::Formatting check failed. Run 'forge fmt script/' in active/evm to fix."
exit 1
fi
- name: Build (forge build)
working-directory: active/evm
run: |
echo "==> forge build"
if ! forge build; then
echo ""
echo "::error::Compilation failed. Check imports, types, and dependency versions."
exit 1
fi