|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - dev |
| 8 | + pull_request: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +env: |
| 14 | + GOPATH: ${{ github.workspace }}/go |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ci-pr-${{ github.event.pull_request.number || github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: Build harmony/bootnode binary (${{ matrix.arch }}) |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + timeout-minutes: 25 |
| 25 | + strategy: &arch-matrix |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + include: |
| 29 | + - os: ubuntu-24.04 |
| 30 | + arch: amd64 |
| 31 | + - os: ubuntu-24.04-arm |
| 32 | + arch: arm64 |
| 33 | + |
| 34 | + steps: |
| 35 | + - &checkout-harmony |
| 36 | + name: Checkout harmony |
| 37 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0 |
| 38 | + with: |
| 39 | + ref: ${{ github.sha }} |
| 40 | + path: go/src/github.com/harmony-one/harmony |
| 41 | + persist-credentials: false |
| 42 | + |
| 43 | + - &checkout-mcl |
| 44 | + name: Checkout mcl |
| 45 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0 |
| 46 | + with: |
| 47 | + repository: harmony-one/mcl |
| 48 | + fetch-depth: 1 |
| 49 | + ref: master |
| 50 | + path: go/src/github.com/harmony-one/mcl |
| 51 | + persist-credentials: false |
| 52 | + |
| 53 | + - &checkout-bls |
| 54 | + name: Checkout bls |
| 55 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0 |
| 56 | + with: |
| 57 | + repository: harmony-one/bls |
| 58 | + fetch-depth: 1 |
| 59 | + ref: master |
| 60 | + path: go/src/github.com/harmony-one/bls |
| 61 | + persist-credentials: false |
| 62 | + |
| 63 | + - &setup-go |
| 64 | + name: Set up Go |
| 65 | + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 #v6.5.0 |
| 66 | + with: |
| 67 | + go-version: '1.24.2' |
| 68 | + cache-dependency-path: go/src/github.com/harmony-one/harmony/go.sum |
| 69 | + |
| 70 | + - name: Build harmony |
| 71 | + run: make linux_static |
| 72 | + working-directory: go/src/github.com/harmony-one/harmony |
| 73 | + |
| 74 | + - name: Upload harmony binaries artifact |
| 75 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1 |
| 76 | + with: |
| 77 | + name: harmony-binaries-${{ matrix.arch }} |
| 78 | + path: | |
| 79 | + go/src/github.com/harmony-one/harmony/bin/harmony |
| 80 | + go/src/github.com/harmony-one/harmony/bin/bootnode |
| 81 | + retention-days: 1 |
| 82 | + if-no-files-found: error |
| 83 | + compression-level: 6 |
| 84 | + |
| 85 | + go-checker: |
| 86 | + name: Run unit tests (${{ matrix.arch }}) |
| 87 | + needs: build |
| 88 | + runs-on: ${{ matrix.os }} |
| 89 | + timeout-minutes: 25 |
| 90 | + strategy: *arch-matrix |
| 91 | + steps: |
| 92 | + - *checkout-harmony |
| 93 | + - *checkout-mcl |
| 94 | + - *checkout-bls |
| 95 | + - *setup-go |
| 96 | + - name: Build mcl |
| 97 | + run: make -j4 |
| 98 | + working-directory: go/src/github.com/harmony-one/mcl |
| 99 | + - name: Build bls |
| 100 | + run: make BLS_SWAP_G=1 -j4 |
| 101 | + working-directory: go/src/github.com/harmony-one/bls |
| 102 | + - name: Install tools |
| 103 | + run: | |
| 104 | + go install golang.org/x/tools/cmd/goimports@v0.30.0 |
| 105 | + go install github.com/fjl/gencodec@v0.1.1 |
| 106 | + working-directory: go/src/github.com/harmony-one/harmony |
| 107 | + - name: Run go checker |
| 108 | + run: | |
| 109 | + make go-get |
| 110 | + bash ./scripts/travis_go_checker.sh |
| 111 | + working-directory: go/src/github.com/harmony-one/harmony |
| 112 | + |
| 113 | + rpc-checker: |
| 114 | + name: Run RPC integration tests (${{ matrix.arch }}) |
| 115 | + needs: build |
| 116 | + runs-on: ${{ matrix.os }} |
| 117 | + timeout-minutes: 25 |
| 118 | + strategy: *arch-matrix |
| 119 | + steps: |
| 120 | + - *checkout-harmony |
| 121 | + - &download-harmony-binaries |
| 122 | + name: Download and extract harmony binaries |
| 123 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c #v8.0.1 |
| 124 | + with: |
| 125 | + name: harmony-binaries-${{ matrix.arch }} |
| 126 | + path: go/src/github.com/harmony-one/harmony/bin |
| 127 | + |
| 128 | + - &prepare-harmony-binaries |
| 129 | + name: Prepare harmony binaries |
| 130 | + run: | |
| 131 | + set -euo pipefail |
| 132 | +
|
| 133 | + chmod +x go/src/github.com/harmony-one/harmony/bin/harmony |
| 134 | + chmod +x go/src/github.com/harmony-one/harmony/bin/bootnode |
| 135 | +
|
| 136 | + test -x go/src/github.com/harmony-one/harmony/bin/harmony |
| 137 | + test -x go/src/github.com/harmony-one/harmony/bin/bootnode |
| 138 | +
|
| 139 | + - &checkout-harmony-test |
| 140 | + name: Checkout harmony-test |
| 141 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0 |
| 142 | + with: |
| 143 | + repository: harmony-one/harmony-test |
| 144 | + ref: master |
| 145 | + fetch-depth: 1 |
| 146 | + path: go/src/github.com/harmony-one/harmony-test |
| 147 | + persist-credentials: false |
| 148 | + |
| 149 | + - name: Run RPC checker |
| 150 | + run: | |
| 151 | + bash ./scripts/travis_rpc_checker.sh |
| 152 | + working-directory: go/src/github.com/harmony-one/harmony |
| 153 | + env: &travis-pr-env |
| 154 | + TRAVIS_PULL_REQUEST_SLUG: ${{ github.event.pull_request.head.repo.full_name }} |
| 155 | + TRAVIS_PULL_REQUEST_BRANCH: ${{ github.head_ref }} |
| 156 | + TRAVIS_BRANCH: ${{ github.ref_name }} |
| 157 | + |
| 158 | + pyhmy-checker: |
| 159 | + name: Run pyhmy tests (${{ matrix.arch }}) |
| 160 | + needs: build |
| 161 | + runs-on: ${{ matrix.os }} |
| 162 | + timeout-minutes: 25 |
| 163 | + strategy: *arch-matrix |
| 164 | + steps: |
| 165 | + - *checkout-harmony |
| 166 | + - *checkout-bls |
| 167 | + - *download-harmony-binaries |
| 168 | + - *prepare-harmony-binaries |
| 169 | + - *checkout-harmony-test |
| 170 | + |
| 171 | + - name: Run pyhmy checker |
| 172 | + run: | |
| 173 | + bash ./scripts/travis_pyhmy_checker.sh |
| 174 | + working-directory: go/src/github.com/harmony-one/harmony |
| 175 | + env: *travis-pr-env |
0 commit comments