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

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

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