go-test.yml 1.2 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 5 6 7 8 9 10 11

on: [push, pull_request]

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