Skip to content

Commit b54736b

Browse files
committed
Add Espresso CI (#168)
1 parent d80a9ca commit b54736b

File tree

5 files changed

+104
-38
lines changed

5 files changed

+104
-38
lines changed

.circleci/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ jobs:
14391439
analyze-op-program-client:
14401440
docker:
14411441
- image: <<pipeline.parameters.default_docker_image>>
1442-
resource_class: xlarge
1442+
resource_class: large
14431443
steps:
14441444
- utils/checkout-with-mise
14451445

@@ -1663,6 +1663,7 @@ workflows:
16631663
- circleci-repo-readonly-authenticated-github-token
16641664
- discord
16651665
- contracts-bedrock-coverage:
1666+
filters: "false"
16661667
# Generate coverage reports.
16671668
name: contracts-bedrock-coverage
16681669
test_timeout: 1h
@@ -1674,6 +1675,7 @@ workflows:
16741675
- circleci-repo-readonly-authenticated-github-token
16751676
- discord
16761677
- contracts-bedrock-tests-upgrade:
1678+
filters: "false"
16771679
name: contracts-bedrock-tests-upgrade
16781680
fork_op_chain: op
16791681
fork_base_chain: mainnet
@@ -1738,6 +1740,7 @@ workflows:
17381740
- circleci-repo-readonly-authenticated-github-token
17391741
- discord
17401742
- fuzz-golang:
1743+
filters: "false"
17411744
name: op-e2e-fuzz
17421745
package_name: op-e2e
17431746
on_changes: op-e2e,packages/contracts-bedrock/src
@@ -1782,6 +1785,7 @@ workflows:
17821785
- circleci-repo-readonly-authenticated-github-token
17831786
- discord
17841787
- analyze-op-program-client:
1788+
filters: "false"
17851789
context:
17861790
- circleci-repo-readonly-authenticated-github-token
17871791
- discord
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Run Espresso integration tests
2+
on:
3+
pull_request:
4+
branches:
5+
- "celo-integration*"
6+
push:
7+
branches:
8+
- "master"
9+
- "celo-integration*"
10+
workflow_dispatch:
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
group: [0, 1, 2, 3]
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Install Nix
24+
uses: nixbuild/nix-quick-install-action@v30
25+
with:
26+
nix_conf: |
27+
keep-env-derivations = true
28+
keep-outputs = true
29+
- name: Restore Nix cache
30+
id: cache-nix-restore
31+
uses: nix-community/cache-nix-action/restore@v6
32+
with:
33+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
34+
- name: Set up Nix environment
35+
uses: nicknovitski/nix-develop@v1
36+
37+
- name: Cache Go modules
38+
uses: actions/setup-go@v5
39+
40+
- name: Compile contracts
41+
run: just compile-contracts
42+
43+
- name: Generate test slice
44+
id: test_split
45+
uses: hashicorp-forge/go-test-split-action@v1
46+
with:
47+
index: ${{ matrix.group }}
48+
total: 4
49+
packages: "./espresso/..."
50+
- name: Run Go tests for group ${{ matrix.group }}
51+
# We skip liveness tests that specify # of seconds, as they're flaky on CI machines
52+
run: |
53+
go test -timeout 30m -p 1 -count 1 -v -run "^(${{ steps.test_split.outputs.run}})$" ./espresso/... \
54+
-skip 'TestE2eDevNetWithEspressoEspressoDegradedLiveness|TestE2eDevNetWithEspressoEspressoDegradedLivenessViaCaffNode|TestE2eDevNetWithEspressoFastConfirmationStability'
55+
56+
- name: Save Nix cache
57+
uses: nix-community/cache-nix-action/save@v6
58+
if: always() && steps.cache-nix-restore.outputs.hit-primary-key != 'true'
59+
with:
60+
primary-key: ${{ steps.cache-nix-restore.outputs.primary-key }}

flake.nix

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
inputs.foundry.overlay
1515
];
1616

17-
go_1_22_7 = pkgs.go_1_22.overrideAttrs (oldAttrs: rec {
18-
version = "1.22.7";
17+
go_1_22_7 = pkgs.go_1_22.overrideAttrs (oldAttrs: rec {
18+
version = "1.22.7";
1919

20-
src = pkgs.fetchurl {
21-
url = "https://go.dev/dl/go1.22.7.src.tar.gz";
22-
sha256 = "sha256-ZkMth9heDPrD7f/mN9WTD8Td9XkzE/4R5KDzMwI8h58=";
23-
};
24-
});
20+
src = pkgs.fetchurl {
21+
url = "https://go.dev/dl/go1.22.7.src.tar.gz";
22+
sha256 = "sha256-ZkMth9heDPrD7f/mN9WTD8Td9XkzE/4R5KDzMwI8h58=";
23+
};
24+
});
2525

2626
espresso_go_lib_version = "v0.0.35";
2727
pkgs = import inputs.nixpkgs { inherit overlays system; };
@@ -64,7 +64,7 @@
6464
pname = "enclaver";
6565
version = "0.5.0";
6666

67-
src = pkgs.fetchFromGitHub {
67+
src = pkgs.fetchFromGitHub {
6868
owner = "enclaver-io";
6969
repo = pname;
7070
rev = "v${version}";
@@ -77,36 +77,36 @@
7777
buildAndTestSubdir = cargoRoot;
7878
};
7979

80-
81-
8280
in
8381
{
8482

8583
formatter = pkgs.nixfmt-rfc-style;
8684

87-
devShell = pkgs.mkShell {
88-
packages = [
89-
enclaver
90-
pkgs.jq
91-
pkgs.yq-go
92-
pkgs.uv
93-
pkgs.shellcheck
94-
pkgs.python311
95-
pkgs.foundry-bin
96-
pkgs.just
97-
go_1_22_7
98-
pkgs.gotools
99-
pkgs.go-ethereum
100-
pkgs.golangci-lint
101-
];
102-
shellHook = ''
103-
export FOUNDRY_DISABLE_NIGHTLY_WARNING=1
104-
export DOWNLOADED_FILE_PATH=${espressoGoLibFile}
105-
echo "Espresso go library ${espresso_go_lib_version} stored at $DOWNLOADED_FILE_PATH"
106-
ln -sf ${espressoGoLibFile} ${target_link}
107-
export CGO_LDFLAGS="${cgo_ld_flags}"
108-
export MACOSX_DEPLOYMENT_TARGET=14.5
109-
'';
85+
devShells = {
86+
default = pkgs.mkShell {
87+
packages = [
88+
enclaver
89+
pkgs.jq
90+
pkgs.yq-go
91+
pkgs.uv
92+
pkgs.shellcheck
93+
pkgs.python311
94+
pkgs.foundry-bin
95+
pkgs.just
96+
go_1_22_7
97+
pkgs.gotools
98+
pkgs.go-ethereum
99+
pkgs.golangci-lint
100+
];
101+
shellHook = ''
102+
export FOUNDRY_DISABLE_NIGHTLY_WARNING=1
103+
export DOWNLOADED_FILE_PATH=${espressoGoLibFile}
104+
echo "Espresso go library ${espresso_go_lib_version} stored at $DOWNLOADED_FILE_PATH"
105+
ln -sf ${espressoGoLibFile} ${target_link}
106+
export CGO_LDFLAGS="${cgo_ld_flags}"
107+
export MACOSX_DEPLOYMENT_TARGET=14.5
108+
'';
109+
};
110110
};
111111
}
112112
);

justfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ build-batcher-enclave-image:
2626
run-test4: compile-contracts
2727
go test ./espresso/environment/4_confirmation_integrity_with_reorgs_test.go -v
2828

29-
espresso-tests: compile-contracts
30-
go test -timeout=30m -p=1 -count=1 ./espresso/environment
29+
espresso_tests_timeout := "30m"
30+
espresso-tests timeout=espresso_tests_timeout: compile-contracts
31+
go test -timeout={{timeout}} -p=1 -count=1 ./espresso/environment
3132

32-
espresso-enclave-tests: compile-contracts build-batcher-enclave-image
33-
ESPRESSO_RUN_ENCLAVE_TESTS=true go test -timeout=30m -p=1 -count=1 ./espresso/enclave-tests/...
33+
espresso-enclave-tests timeout=espresso_tests_timeout: compile-contracts build-batcher-enclave-image
34+
ESPRESSO_RUN_ENCLAVE_TESTS=true go test -timeout={{timeout}} -p=1 -count=1 ./espresso/enclave-tests/...
3435

3536
IMAGE_NAME := "ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:release-colorful-snake"
3637
remove-espresso-containers:

packages/contracts-bedrock/scripts/checks/check-semver-diff.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# shellcheck disable=all # Celo's early exit below breaks shellcheck
23
set -euo pipefail
34

45
# Celo: contract changes are handled differently, skip semver check for now.

0 commit comments

Comments
 (0)