Skip to content

Commit c52dfd6

Browse files
committed
cleanup
1 parent e7d1336 commit c52dfd6

File tree

7 files changed

+272
-199
lines changed

7 files changed

+272
-199
lines changed
Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,100 @@
11
name: E2E Nix Tests
22
on:
3-
push:
4-
branches:
5-
- main
6-
- release/**
3+
push:
4+
branches: [ main, release/** ]
75
pull_request:
8-
branches:
9-
- main
10-
- release/**
6+
branches: [ main, release/** ]
117

128
concurrency:
139
group: ${{ github.workflow }}-${{ github.ref }}
1410
cancel-in-progress: true
1511

1612
jobs:
17-
integration_tests:
13+
build-env:
1814
runs-on: ubuntu-latest
19-
timeout-minutes: 240
20-
strategy:
21-
matrix:
22-
tests: [all]
23-
env:
24-
TESTS_TO_RUN: ${{ matrix.tests }}
15+
outputs:
16+
run_tests: ${{ steps.set-run-tests.outputs.run_tests }}
2517
steps:
26-
- name: Create more disk space
27-
run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
28-
- uses: actions/checkout@v3
18+
- name: Checkout
19+
uses: actions/checkout@v4
2920
with:
3021
submodules: recursive
3122
fetch-depth: 1
23+
- name: Skip marker (commit message)
24+
run: |
25+
msg="$(git log -1 --pretty=%B)"
26+
if echo "$msg" | grep -qi '\[skip e2e\]'; then
27+
echo "Skipping E2E by marker."
28+
echo "run_tests=false" >> "$GITHUB_OUTPUT"
29+
exit 0
30+
fi
3231
- id: changed-files
33-
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
32+
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c
3433
with:
3534
files: |
36-
docs
37-
*.md
35+
docs/**
3836
**/*.md
39-
- uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
37+
- id: set-run-tests
38+
run: |
39+
if [ "${{ steps.changed-files.outputs.only_changed }}" = "true" ]; then
40+
echo "Docs-only change detected. Skipping tests."
41+
echo "run_tests=false" >> "$GITHUB_OUTPUT"
42+
exit 0
43+
fi
44+
echo "run_tests=true" >> "$GITHUB_OUTPUT"
45+
- name: Free disk space
46+
if: steps.set-run-tests.outputs.run_tests == 'true'
47+
run: sudo rm -rf /usr/share/dotnet /opt/ghc "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY" || true
48+
- name: Install Nix
49+
if: steps.set-run-tests.outputs.run_tests == 'true'
50+
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b
51+
with:
52+
nix_path: nixpkgs=channel:nixos-25.05
53+
extra_nix_config: |
54+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
55+
sandbox = false
56+
- name: Enable Magic Nix Cache
57+
if: steps.set-run-tests.outputs.run_tests == 'true'
58+
uses: DeterminateSystems/magic-nix-cache-action@main
59+
- name: Pre-build dependencies (warm cache)
60+
if: steps.set-run-tests.outputs.run_tests == 'true'
61+
run: |
62+
nix build .#evmd .#hermes || true
63+
integration_tests:
64+
needs: build-env
65+
if: needs.build-env.outputs.run_tests == 'true'
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 240
68+
strategy:
69+
fail-fast: true
70+
matrix:
71+
group: [all]
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v4
75+
with:
76+
submodules: recursive
77+
fetch-depth: 1
78+
- name: Install Nix
79+
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b
4080
with:
4181
nix_path: nixpkgs=channel:nixos-25.05
4282
extra_nix_config: |
4383
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
4484
sandbox = false
45-
if: steps.changed-files.outputs.only_changed == 'false'
46-
- uses: DeterminateSystems/magic-nix-cache-action@main
47-
if: steps.changed-files.outputs.only_changed == 'false'
48-
- name: Run integration tests
49-
if: steps.changed-files.outputs.only_changed == 'false'
50-
run: make test-e2e-nix
51-
- name: 'Tar debug files'
85+
- name: Enable Magic Nix Cache
86+
uses: DeterminateSystems/magic-nix-cache-action@main
87+
- name: Run test group via Makefile
88+
env:
89+
TESTS_TO_RUN: ${{ matrix.group }}
90+
run: make test-e2e-nix TESTS_TO_RUN="${TESTS_TO_RUN}"
91+
- name: Collect debug artifacts
5292
if: failure()
53-
run: tar cfz debug_files.tar.gz -C "${TMPDIR-/tmp}/pytest-of-runner" .
54-
- uses: actions/upload-artifact@v4
93+
run: tar cfz debug_${{ matrix.group }}.tar.gz -C "${TMPDIR-/tmp}/pytest-of-runner" . || true
94+
- name: Upload debug artifacts
5595
if: failure()
96+
uses: actions/upload-artifact@v4
5697
with:
57-
name: debug-files-${{ matrix.tests }}
58-
path: debug_files.tar.gz
98+
name: debug-${{ matrix.group }}
99+
path: debug_${{ matrix.group }}.tar.gz
59100
if-no-files-found: ignore

flake.lock

Lines changed: 1 addition & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/release-25.05";
44
flake-utils.url = "github:numtide/flake-utils";
5-
poetry2nix = {
6-
url = "github:nix-community/poetry2nix";
7-
inputs.nixpkgs.follows = "nixpkgs";
8-
inputs.flake-utils.follows = "flake-utils";
9-
};
105
hermes = {
116
url = "github:mmsqe/ibc-rs/ae80ab348952840696e6c9a0c7096d2de11ea579";
127
flake = false;
@@ -18,7 +13,6 @@
1813
self,
1914
nixpkgs,
2015
flake-utils,
21-
poetry2nix,
2216
hermes,
2317
}:
2418
let
@@ -56,7 +50,6 @@
5650
))
5751
// {
5852
overlays.default = [
59-
poetry2nix.overlays.default
6053
(final: super: {
6154
evmd = final.callPackage ./. { inherit rev; };
6255
hermes = final.callPackage ./tests/nix/hermes.nix { src = hermes; };

tests/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/make -f
2+
3+
TESTS_TO_RUN ?= all
4+
5+
NIX_DEV_CMD = nix develop --accept-flake-config -c
6+
7+
test-e2e-nix:
8+
@echo "TESTS_TO_RUN=$(TESTS_TO_RUN)"
9+
@bash scripts/restore_envs.sh
10+
@CHAIN_CONFIG=$(CHAIN_CONFIG) TESTS_TO_RUN=$(TESTS_TO_RUN) bash scripts/run-integration-tests.sh
11+
12+
dev:
13+
@$(NIX_DEV_CMD) bash
14+
15+
lint-py:
16+
@cd integration_tests && uv run flake8 --show-source --count --statistics --format="::error file=%(path)s,line=%(row)d,col=%(col)d::%(path)s:%(row)d:%(col)d: %(code)s %(text)s"
17+
18+
.PHONY: test-e2e-nix dev lint-py

tests/integration_tests/Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)