|
1 |
| -# File managed by web3-bot. DO NOT EDIT. |
2 |
| -# See https://github.com/protocol/.github/ for details. |
3 |
| - |
4 |
| -on: [push, pull_request] |
5 | 1 | name: Go Test
|
6 | 2 |
|
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: ["master"] |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
7 | 16 | jobs:
|
8 |
| - unit: |
9 |
| - strategy: |
10 |
| - fail-fast: false |
11 |
| - matrix: |
12 |
| - os: [ "ubuntu", "windows", "macos" ] |
13 |
| - go: [ "1.18.x", "1.19.x" ] |
14 |
| - env: |
15 |
| - COVERAGES: "" |
16 |
| - runs-on: ${{ format('{0}-latest', matrix.os) }} |
17 |
| - name: ${{ matrix.os }} (go ${{ matrix.go }}) |
18 |
| - steps: |
19 |
| - - uses: actions/checkout@v3 |
20 |
| - with: |
21 |
| - submodules: recursive |
22 |
| - - uses: actions/setup-go@v3 |
23 |
| - with: |
24 |
| - go-version: ${{ matrix.go }} |
25 |
| - - name: Go information |
26 |
| - run: | |
27 |
| - go version |
28 |
| - go env |
29 |
| - - name: Use msys2 on windows |
30 |
| - if: ${{ matrix.os == 'windows' }} |
31 |
| - shell: bash |
32 |
| - # The executable for msys2 is also called bash.cmd |
33 |
| - # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells |
34 |
| - # If we prepend its location to the PATH |
35 |
| - # subsequent 'shell: bash' steps will use msys2 instead of gitbash |
36 |
| - run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH |
37 |
| - - name: Run repo-specific setup |
38 |
| - uses: ./.github/actions/go-test-setup |
39 |
| - if: hashFiles('./.github/actions/go-test-setup') != '' |
40 |
| - - name: Run tests |
41 |
| - uses: protocol/multiple-go-modules@v1.2 |
42 |
| - with: |
43 |
| - # Use -coverpkg=./..., so that we include cross-package coverage. |
44 |
| - # If package ./A imports ./B, and ./A's tests also cover ./B, |
45 |
| - # this means ./B's coverage will be significantly higher than 0%. |
46 |
| - run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./... |
47 |
| - - name: Run tests (32 bit) |
48 |
| - if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. |
49 |
| - uses: protocol/multiple-go-modules@v1.2 |
50 |
| - env: |
51 |
| - GOARCH: 386 |
52 |
| - with: |
53 |
| - run: | |
54 |
| - export "PATH=${{ env.PATH_386 }}:$PATH" |
55 |
| - go test -v -shuffle=on ./... |
56 |
| - - name: Run tests with race detector |
57 |
| - if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow |
58 |
| - uses: protocol/multiple-go-modules@v1.2 |
59 |
| - with: |
60 |
| - run: go test -v -race ./... |
61 |
| - - name: Collect coverage files |
62 |
| - shell: bash |
63 |
| - run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV |
64 |
| - - name: Upload coverage to Codecov |
65 |
| - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 |
66 |
| - with: |
67 |
| - files: '${{ env.COVERAGES }}' |
68 |
| - env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }} |
| 17 | + go-test: |
| 18 | + uses: pl-strflt/uci/.github/workflows/go-test.yml@v0.0 |
0 commit comments