|
| 1 | +name: Daily |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: "45 3 * * *" |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + max-parallel: 20 |
| 11 | + matrix: |
| 12 | + target: |
| 13 | + - os: linux |
| 14 | + cpu: amd64 |
| 15 | + - os: linux |
| 16 | + cpu: i386 |
| 17 | + - os: macos |
| 18 | + cpu: amd64 |
| 19 | + - os: windows |
| 20 | + cpu: amd64 |
| 21 | + - os: windows |
| 22 | + cpu: i386 |
| 23 | + branch: [version-1-2, version-1-4, devel] |
| 24 | + include: |
| 25 | + - target: |
| 26 | + os: linux |
| 27 | + builder: ubuntu-18.04 |
| 28 | + shell: bash |
| 29 | + - target: |
| 30 | + os: macos |
| 31 | + builder: macos-10.15 |
| 32 | + shell: bash |
| 33 | + - target: |
| 34 | + os: windows |
| 35 | + builder: windows-2019 |
| 36 | + shell: msys2 {0} |
| 37 | + |
| 38 | + defaults: |
| 39 | + run: |
| 40 | + shell: ${{ matrix.shell }} |
| 41 | + |
| 42 | + name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})' |
| 43 | + runs-on: ${{ matrix.builder }} |
| 44 | + continue-on-error: ${{ matrix.branch }} == 'devel' |
| 45 | + steps: |
| 46 | + - name: Checkout nimbus-eth2 |
| 47 | + uses: actions/checkout@v2 |
| 48 | + with: |
| 49 | + ref: unstable |
| 50 | + |
| 51 | + - name: Derive environment variables |
| 52 | + shell: bash |
| 53 | + run: | |
| 54 | + if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then |
| 55 | + PLATFORM=x64 |
| 56 | + else |
| 57 | + PLATFORM=x86 |
| 58 | + fi |
| 59 | + echo "PLATFORM=${PLATFORM}" >> $GITHUB_ENV |
| 60 | +
|
| 61 | + # libminiupnp / natpmp |
| 62 | + if [[ '${{ runner.os }}' == 'Linux' && '${{ matrix.target.cpu }}' == 'i386' ]]; then |
| 63 | + export CFLAGS="${CFLAGS} -m32 -mno-adx" |
| 64 | + echo "CFLAGS=${CFLAGS}" >> $GITHUB_ENV |
| 65 | + fi |
| 66 | +
|
| 67 | + ncpu="" |
| 68 | + case '${{ runner.os }}' in |
| 69 | + 'Linux') |
| 70 | + ncpu=$(nproc) |
| 71 | + ;; |
| 72 | + 'macOS') |
| 73 | + ncpu=$(sysctl -n hw.ncpu) |
| 74 | + ;; |
| 75 | + 'Windows') |
| 76 | + ncpu=${NUMBER_OF_PROCESSORS} |
| 77 | + ;; |
| 78 | + esac |
| 79 | + [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 |
| 80 | + echo "ncpu=${ncpu}" >> $GITHUB_ENV |
| 81 | +
|
| 82 | + - name: Install build dependencies (Linux i386) |
| 83 | + if: runner.os == 'Linux' && matrix.target.cpu == 'i386' |
| 84 | + run: | |
| 85 | + sudo dpkg --add-architecture i386 |
| 86 | + sudo apt-fast update -qq |
| 87 | + sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ |
| 88 | + --no-install-recommends -yq gcc-multilib g++-multilib |
| 89 | + mkdir -p external/bin |
| 90 | + cat << EOF > external/bin/gcc |
| 91 | + #!/bin/bash |
| 92 | + exec $(which gcc) -m32 -mno-adx "\$@" |
| 93 | + EOF |
| 94 | + cat << EOF > external/bin/g++ |
| 95 | + #!/bin/bash |
| 96 | + exec $(which g++) -m32 -mno-adx "\$@" |
| 97 | + EOF |
| 98 | + chmod 755 external/bin/gcc external/bin/g++ |
| 99 | + echo "${{ github.workspace }}/external/bin" >> $GITHUB_PATH |
| 100 | +
|
| 101 | + - name: MSYS2 (Windows i386) |
| 102 | + if: runner.os == 'Windows' && matrix.target.cpu == 'i386' |
| 103 | + uses: msys2/setup-msys2@v2 |
| 104 | + with: |
| 105 | + path-type: inherit |
| 106 | + msystem: MINGW32 |
| 107 | + install: >- |
| 108 | + base-devel |
| 109 | + git |
| 110 | + mingw-w64-i686-toolchain |
| 111 | +
|
| 112 | + - name: MSYS2 (Windows amd64) |
| 113 | + if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' |
| 114 | + uses: msys2/setup-msys2@v2 |
| 115 | + with: |
| 116 | + path-type: inherit |
| 117 | + install: >- |
| 118 | + base-devel |
| 119 | + git |
| 120 | + mingw-w64-x86_64-toolchain |
| 121 | +
|
| 122 | + - name: Restore Nim DLLs dependencies (Windows) from cache |
| 123 | + if: runner.os == 'Windows' |
| 124 | + id: windows-dlls-cache |
| 125 | + uses: actions/cache@v2 |
| 126 | + with: |
| 127 | + path: external/dlls-${{ matrix.target.cpu }} |
| 128 | + key: 'dlls-${{ matrix.target.cpu }}' |
| 129 | + |
| 130 | + - name: Install DLLs dependencies (Windows) |
| 131 | + if: > |
| 132 | + steps.windows-dlls-cache.outputs.cache-hit != 'true' && |
| 133 | + runner.os == 'Windows' |
| 134 | + shell: bash |
| 135 | + run: | |
| 136 | + mkdir -p external |
| 137 | + curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip |
| 138 | + 7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }} |
| 139 | +
|
| 140 | + - name: Path to cached dependencies (Windows) |
| 141 | + if: > |
| 142 | + runner.os == 'Windows' |
| 143 | + shell: bash |
| 144 | + run: | |
| 145 | + echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH |
| 146 | +
|
| 147 | + - name: Install build dependencies (macOS) |
| 148 | + if: runner.os == 'macOS' |
| 149 | + shell: bash |
| 150 | + run: | |
| 151 | + brew install gnu-getopt |
| 152 | + brew link --force gnu-getopt |
| 153 | +
|
| 154 | + - name: Get latest fixtures commit hash |
| 155 | + id: fixtures_version |
| 156 | + shell: bash |
| 157 | + run: | |
| 158 | + getHash() { |
| 159 | + git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1 |
| 160 | + } |
| 161 | + fixturesHash=$(getHash status-im/nim-eth2-scenarios) |
| 162 | + echo "::set-output name=fixtures::${fixturesHash}" |
| 163 | +
|
| 164 | + - name: Restore Ethereum Foundation fixtures from cache |
| 165 | + id: fixtures-cache |
| 166 | + uses: actions/cache@v2 |
| 167 | + with: |
| 168 | + path: fixturesCache |
| 169 | + key: 'eth2-scenarios-${{ steps.fixtures_version.outputs.fixtures }}' |
| 170 | + |
| 171 | + - name: Get the Ethereum Foundation fixtures |
| 172 | + shell: bash |
| 173 | + run: | |
| 174 | + scripts/setup_official_tests.sh fixturesCache |
| 175 | +
|
| 176 | + - name: Build Nim and Nimbus dependencies |
| 177 | + shell: bash |
| 178 | + run: | |
| 179 | + make -j ${ncpu} NIM_COMMIT=${{ matrix.branch }} ARCH_OVERRIDE=${PLATFORM} QUICK_AND_DIRTY_COMPILER=1 update |
| 180 | +
|
| 181 | + - name: Smoke test the Beacon Node and Validator Client with all tracing enabled |
| 182 | + shell: bash |
| 183 | + run: | |
| 184 | + make -j ${ncpu} NIM_COMMIT=${{ matrix.branch }} LOG_LEVEL=TRACE NIMFLAGS="-d:testnet_servers_image" nimbus_beacon_node nimbus_validator_client |
| 185 | +
|
| 186 | + - name: Run nimbus-eth2 tests |
| 187 | + shell: bash |
| 188 | + run: | |
| 189 | + make -j ${ncpu} NIM_COMMIT=${{ matrix.branch }} DISABLE_TEST_FIXTURES_SCRIPT=1 test |
| 190 | +
|
0 commit comments