|
1 | 1 | name: E2E Nix Tests |
2 | 2 | on: |
3 | | - push: |
4 | | - branches: |
5 | | - - main |
6 | | - - release/** |
| 3 | + push: |
| 4 | + branches: [ main, release/** ] |
7 | 5 | pull_request: |
8 | | - branches: |
9 | | - - main |
10 | | - - release/** |
| 6 | + branches: [ main, release/** ] |
11 | 7 |
|
12 | 8 | concurrency: |
13 | 9 | group: ${{ github.workflow }}-${{ github.ref }} |
14 | 10 | cancel-in-progress: true |
15 | 11 |
|
16 | 12 | jobs: |
17 | | - integration_tests: |
| 13 | + build-env: |
18 | 14 | 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 }} |
25 | 17 | 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 |
29 | 20 | with: |
30 | 21 | submodules: recursive |
31 | 22 | 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 |
32 | 31 | - id: changed-files |
33 | | - uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 |
| 32 | + uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c |
34 | 33 | with: |
35 | 34 | files: | |
36 | | - docs |
37 | | - *.md |
| 35 | + docs/** |
38 | 36 | **/*.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 |
40 | 80 | with: |
41 | 81 | nix_path: nixpkgs=channel:nixos-25.05 |
42 | 82 | extra_nix_config: | |
43 | 83 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} |
44 | 84 | 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 |
52 | 92 | 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 |
55 | 95 | if: failure() |
| 96 | + uses: actions/upload-artifact@v4 |
56 | 97 | 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 |
59 | 100 | if-no-files-found: ignore |
0 commit comments