go-test.yml 1.44 KB
Newer Older
web3-bot's avatar
web3-bot committed
1 2 3 4
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

on: [push, pull_request]
5
name: Go Test
web3-bot's avatar
web3-bot committed
6 7 8 9 10 11 12 13 14

jobs:
  unit:
    strategy:
      fail-fast: false
      matrix:
        os: [ "ubuntu", "windows", "macos" ]
        go: [ "1.15.x", "1.16.x" ]
    runs-on: ${{ matrix.os }}-latest
15
    name: ${{ matrix.os}} (go ${{ matrix.go }})
web3-bot's avatar
web3-bot committed
16 17
    steps:
      - uses: actions/checkout@v2
18 19
        with:
          submodules: recursive
web3-bot's avatar
web3-bot committed
20 21 22 23 24 25 26 27
      - uses: actions/setup-go@v2
        with:
          go-version: ${{ matrix.go }}
      - name: Go information
        run: |
          go version
          go env
      - name: Run tests
28 29 30
        uses: protocol/multiple-go-modules@v1.0
        with:
          run: go test -v -coverprofile coverage.txt ./...
web3-bot's avatar
web3-bot committed
31 32
      - name: Run tests (32 bit)
        if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
33
        uses: protocol/multiple-go-modules@v1.0
web3-bot's avatar
web3-bot committed
34 35
        env:
          GOARCH: 386
36 37
        with:
          run: go test -v ./...
web3-bot's avatar
web3-bot committed
38 39
      - name: Run tests with race detector
        if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
40 41 42
        uses: protocol/multiple-go-modules@v1.0
        with:
          run: go test -v -race ./...
web3-bot's avatar
web3-bot committed
43
      - name: Upload coverage to Codecov
44
        uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # v1.5.0
web3-bot's avatar
web3-bot committed
45 46 47
        with:
          file: coverage.txt
          env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}