-
Notifications
You must be signed in to change notification settings - Fork 20
87 lines (70 loc) · 2.44 KB
/
contracts-unit-tests.yml
File metadata and controls
87 lines (70 loc) · 2.44 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
name: contracts-unit-tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: contracts-unit-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
# ---------------------------------------------------------------------------
# Job 1: Foundry contract unit tests
# Runs forge test against CelestiaDAProofValidator and MockBlobstream.
# No live node or Blobstream contract needed.
# ---------------------------------------------------------------------------
foundry:
name: Foundry contract tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
- name: Install soldeer dependencies
working-directory: contracts
run: forge soldeer install
- name: Build contracts
working-directory: contracts
run: forge build --sizes
- name: Run Foundry tests
working-directory: contracts
run: forge test --summary -vvv
- name: Check gas snapshots (informational)
working-directory: contracts
run: forge snapshot --check --tolerance 5 || true
# ---------------------------------------------------------------------------
# Job 2: Go unit tests (no live Celestia node required)
# Runs only tests that do not require NAMESPACE / ETH_RPC / BLOBSTREAM_ADDR.
# ---------------------------------------------------------------------------
go-unit:
name: Go unit tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Download Go modules
run: go mod download
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Run cert package tests
run: go test ./daserver/cert/... -v -count=1
- name: Run Go proof/unit tests
run: go test ./daserver/... -run 'Test(GenerateReadPreimageProof_.*|GenerateCertificateValidityProof_.*|BuildReadResultFromShares_.*|PayloadOffsetShareMapping|ReadChunkShareSelectionMatrix|ValidateReadResult_RejectsMutatedDataRoot)' -v -count=1