github.com/koko1123/flow-go-1@v0.29.6/.github/workflows/flaky-test-debug.yml (about) 1 name: Flaky Test Debug 2 3 on: 4 push: 5 branches: 6 - '**/*flaky-test-debug*' 7 env: 8 GO_VERSION: 1.19 9 10 #concurrency: 11 # group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} 12 # cancel-in-progress: true 13 14 jobs: 15 golangci: 16 strategy: 17 fail-fast: false 18 matrix: 19 dir: [./, ./integration/, ./crypto/, ./insecure/] 20 name: Lint 21 runs-on: ubuntu-latest 22 steps: 23 - name: Checkout repo 24 uses: actions/checkout@v3 25 - name: Setup Go 26 uses: actions/setup-go@v3 27 with: 28 go-version: ${{ env.GO_VERSION }} 29 cache: true 30 - name: Build relic 31 run: make crypto_setup_gopath 32 - name: Run go generate 33 run: go generate 34 working-directory: ${{ matrix.dir }} 35 - name: Run golangci-lint 36 uses: golangci/golangci-lint-action@v3 37 with: 38 # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. 39 version: v1.49 40 args: -v --build-tags relic 41 working-directory: ${{ matrix.dir }} 42 # https://github.com/golangci/golangci-lint-action/issues/244 43 skip-cache: true 44 45 tidy: 46 name: Tidy 47 runs-on: ubuntu-latest 48 steps: 49 - name: Checkout repo 50 uses: actions/checkout@v3 51 - name: Setup Go 52 uses: actions/setup-go@v3 53 with: 54 go-version: ${{ env.GO_VERSION }} 55 cache: true 56 - name: Run tidy 57 run: make tidy 58 - name: Emulator no relic check 59 run: make emulator-norelic-check 60 61 # shell-check: 62 # name: ShellCheck 63 # runs-on: ubuntu-latest 64 # steps: 65 # - name: Checkout repo 66 # uses: actions/checkout@v3 67 # - name: Run ShellCheck 68 # uses: ludeeus/action-shellcheck@203a3fd018dfe73f8ae7e3aa8da2c149a5f41c33 69 # with: 70 # scandir: './crypto' 71 # ignore: 'relic' 72 73 create-dynamic-test-matrix: 74 name: Create Dynamic Test Matrix 75 runs-on: ubuntu-latest 76 outputs: 77 dynamic-matrix: ${{ steps.set-test-matrix.outputs.dynamicMatrix }} 78 steps: 79 - name: Checkout repo 80 uses: actions/checkout@v3 81 - name: Setup Go 82 uses: actions/setup-go@v3 83 with: 84 go-version: ${{ env.GO_VERSION }} 85 cache: true 86 - name: Set Test Matrix 87 id: set-test-matrix 88 # modify which module to unit test by changing the argument to test_matrix.go 89 run: go run utils/test_matrix/test_matrix.go network 90 # run: go run utils/test_matrix/test_matrix.go access admin cmd consensus engine fvm ledger module network utils 91 92 unit-test: 93 name: Unit Tests (${{ matrix.targets.name }}) 94 needs: create-dynamic-test-matrix 95 strategy: 96 fail-fast: false 97 matrix: 98 targets: ${{ fromJSON(needs.create-dynamic-test-matrix.outputs.dynamic-matrix)}} 99 # need to set image explicitly due to GitHub logging issue as described in https://github.com/onflow/flow-go/pull/3087#issuecomment-1234383202 100 runs-on: ubuntu-20.04 101 steps: 102 - name: Checkout repo 103 uses: actions/checkout@v3 104 - name: Setup Go 105 uses: actions/setup-go@v3 106 with: 107 go-version: ${{ env.GO_VERSION }} 108 cache: true 109 - name: Run tests (${{ matrix.targets.name }}) 110 if: github.actor != 'bors[bot]' 111 run: make -e GO_TEST_PACKAGES="${{ matrix.targets.packages }}" ci 112 # TODO(rbtz): re-enable when we fix exisiting races. 113 #env: 114 # RACE_DETECTOR: 1 115 - name: Run tests (Bors) 116 if: github.actor == 'bors[bot]' 117 uses: nick-invision/retry@v2 118 with: 119 timeout_minutes: 25 120 max_attempts: 3 121 command: make -e GO_TEST_PACKAGES="${{ matrix.targets.packages }}" ci 122 - name: Upload coverage report 123 uses: codecov/codecov-action@v3 124 with: 125 file: ./coverage.txt 126 flags: unittests 127 name: codecov-umbrella 128 129 # unit-test-modules: 130 # name: Unit Tests (Modules) 131 # strategy: 132 # fail-fast: false 133 # matrix: 134 # include: 135 # - name: crypto 136 # make1: -C crypto setup 137 # make2: unittest 138 # retries: 1 139 # race: 1 140 # - name: insecure 141 # make1: install-tools 142 # make2: test 143 # retries: 3 144 # race: 1 145 # - name: integration 146 # make1: install-tools 147 # make2: test 148 # retries: 3 149 # race: 0 150 # runs-on: ubuntu-latest 151 # steps: 152 # - name: Checkout repo 153 # uses: actions/checkout@v3 154 # - name: Setup Go 155 # uses: actions/setup-go@v3 156 # with: 157 # go-version: ${{ env.GO_VERSION }} 158 # cache: true 159 # - name: Run tests (${{ matrix.name }}) 160 # if: github.actor != 'bors[bot]' 161 # env: 162 # RACE_DETECTOR: ${{ matrix.race }} 163 # # run `make1` target before running `make2` target inside each module's root 164 # run: | 165 # make ${{ matrix.make1 }} 166 # make -C ${{ matrix.name }} ${{ matrix.make2 }} 167 # - name: Run tests (Bors) 168 # if: github.actor == 'bors[bot]' 169 # uses: nick-invision/retry@v2 170 # with: 171 # timeout_minutes: 25 172 # max_attempts: ${{ matrix.retries }} 173 # command: | 174 # make ${{ matrix.make1 }} 175 # make -C ${{ matrix.name }} ${{ matrix.make2 }} 176 # - name: Upload coverage report 177 # uses: codecov/codecov-action@v3 178 # with: 179 # file: ./coverage.txt 180 # flags: unittests 181 # name: codecov-umbrella 182 183 integration-test: 184 name: Integration Tests 185 strategy: 186 fail-fast: false 187 matrix: 188 # modify which integration module to test by adding / removing the matrix targets 189 make: 190 # - make -C integration access-tests 191 # - make -C integration bft-tests 192 # - make -C integration collection-tests 193 # - make -C integration consensus-tests 194 - make -C integration epochs-tests 195 # - make -C integration execution-tests 196 # - make -C integration ghost-tests 197 # - make -C integration mvp-tests 198 # - make -C integration network-tests 199 # - make -C integration verification-tests 200 runs-on: ubuntu-latest 201 steps: 202 - name: Checkout repo 203 uses: actions/checkout@v3 204 - name: Setup Go 205 uses: actions/setup-go@v3 206 with: 207 go-version: ${{ env.GO_VERSION }} 208 cache: true 209 - name: Build relic 210 run: make crypto_setup_gopath 211 - name: Docker build 212 run: make docker-build-flow docker-build-flow-corrupt 213 - name: Run tests 214 if: github.actor != 'bors[bot]' 215 run: VERBOSE=1 ${{ matrix.make }} 216 # TODO(rbtz): re-enable when we fix existing races. 217 #env: 218 # RACE_DETECTOR: 1 219 - name: Run tests (Bors) 220 if: github.actor == 'bors[bot]' 221 uses: nick-invision/retry@v2 222 with: 223 timeout_minutes: 15 224 max_attempts: 2 225 command: ${{ matrix.make }}