|
| 1 | +# We only run tests on `RECENT_FORKS` on CI. To make sure we don't break prior forks, we run nightly tests to cover all prior forks. |
| 2 | +name: nightly-tests |
| 3 | + |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + # Run at 8:30 AM UTC every day |
| 7 | + - cron: '30 8 * * *' |
| 8 | + workflow_dispatch: # Allow manual triggering |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +env: |
| 15 | + # Deny warnings in CI |
| 16 | + # Disable debug info (see https://github.com/sigp/lighthouse/issues/4005) |
| 17 | + RUSTFLAGS: "-D warnings -C debuginfo=0" |
| 18 | + # Prevent Github API rate limiting. |
| 19 | + LIGHTHOUSE_GITHUB_TOKEN: ${{ secrets.LIGHTHOUSE_GITHUB_TOKEN }} |
| 20 | + # Disable incremental compilation |
| 21 | + CARGO_INCREMENTAL: 0 |
| 22 | + # Enable portable to prevent issues with caching `blst` for the wrong CPU type |
| 23 | + TEST_FEATURES: portable |
| 24 | + |
| 25 | +jobs: |
| 26 | + setup-matrix: |
| 27 | + name: setup-matrix |
| 28 | + runs-on: ubuntu-latest |
| 29 | + outputs: |
| 30 | + forks: ${{ steps.set-matrix.outputs.forks }} |
| 31 | + steps: |
| 32 | + - name: Set matrix |
| 33 | + id: set-matrix |
| 34 | + run: | |
| 35 | + # All prior forks to cover in nightly tests. This list should be updated when we remove a fork from `RECENT_FORKS`. |
| 36 | + echo 'forks=["phase0", "altair", "bellatrix", "capella", "deneb"]' >> $GITHUB_OUTPUT |
| 37 | +
|
| 38 | + beacon-chain-tests: |
| 39 | + name: beacon-chain-tests |
| 40 | + needs: setup-matrix |
| 41 | + runs-on: 'ubuntu-latest' |
| 42 | + env: |
| 43 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + fork: ${{ fromJson(needs.setup-matrix.outputs.forks) }} |
| 47 | + fail-fast: false |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v5 |
| 50 | + - name: Get latest version of stable Rust |
| 51 | + uses: moonrepo/setup-rust@v1 |
| 52 | + with: |
| 53 | + channel: stable |
| 54 | + cache-target: release |
| 55 | + bins: cargo-nextest |
| 56 | + - name: Run beacon_chain tests for ${{ matrix.fork }} |
| 57 | + run: make test-beacon-chain-${{ matrix.fork }} |
| 58 | + timeout-minutes: 60 |
| 59 | + |
| 60 | + http-api-tests: |
| 61 | + name: http-api-tests |
| 62 | + needs: setup-matrix |
| 63 | + runs-on: 'ubuntu-latest' |
| 64 | + env: |
| 65 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + fork: ${{ fromJson(needs.setup-matrix.outputs.forks) }} |
| 69 | + fail-fast: false |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v5 |
| 72 | + - name: Get latest version of stable Rust |
| 73 | + uses: moonrepo/setup-rust@v1 |
| 74 | + with: |
| 75 | + channel: stable |
| 76 | + cache-target: release |
| 77 | + bins: cargo-nextest |
| 78 | + - name: Run http_api tests for ${{ matrix.fork }} |
| 79 | + run: make test-http-api-${{ matrix.fork }} |
| 80 | + timeout-minutes: 60 |
| 81 | + |
| 82 | + op-pool-tests: |
| 83 | + name: op-pool-tests |
| 84 | + needs: setup-matrix |
| 85 | + runs-on: ubuntu-latest |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + strategy: |
| 89 | + matrix: |
| 90 | + fork: ${{ fromJson(needs.setup-matrix.outputs.forks) }} |
| 91 | + fail-fast: false |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v5 |
| 94 | + - name: Get latest version of stable Rust |
| 95 | + uses: moonrepo/setup-rust@v1 |
| 96 | + with: |
| 97 | + channel: stable |
| 98 | + cache-target: release |
| 99 | + bins: cargo-nextest |
| 100 | + - name: Run operation_pool tests for ${{ matrix.fork }} |
| 101 | + run: make test-op-pool-${{ matrix.fork }} |
| 102 | + timeout-minutes: 60 |
| 103 | + |
| 104 | + network-tests: |
| 105 | + name: network-tests |
| 106 | + needs: setup-matrix |
| 107 | + runs-on: ubuntu-latest |
| 108 | + env: |
| 109 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 110 | + strategy: |
| 111 | + matrix: |
| 112 | + fork: ${{ fromJson(needs.setup-matrix.outputs.forks) }} |
| 113 | + fail-fast: false |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v5 |
| 116 | + - name: Get latest version of stable Rust |
| 117 | + uses: moonrepo/setup-rust@v1 |
| 118 | + with: |
| 119 | + channel: stable |
| 120 | + cache-target: release |
| 121 | + bins: cargo-nextest |
| 122 | + - name: Create CI logger dir |
| 123 | + run: mkdir ${{ runner.temp }}/network_test_logs |
| 124 | + - name: Run network tests for ${{ matrix.fork }} |
| 125 | + run: make test-network-${{ matrix.fork }} |
| 126 | + timeout-minutes: 60 |
| 127 | + env: |
| 128 | + TEST_FEATURES: portable |
| 129 | + CI_LOGGER_DIR: ${{ runner.temp }}/network_test_logs |
| 130 | + - name: Upload logs |
| 131 | + if: always() |
| 132 | + uses: actions/upload-artifact@v4 |
| 133 | + with: |
| 134 | + name: network_test_logs_${{ matrix.fork }} |
| 135 | + path: ${{ runner.temp }}/network_test_logs |
0 commit comments