name: Codecov workflow on: push: branches: - main paths: - '**.go' - 'go.*' - '.github/**' - 'codecov.yml' pull_request: branches: - main paths: - '**.go' - 'go.*' - '.github/**' - 'codecov.yml' jobs: run: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Checkout Code uses: actions/checkout@master - name: Install Dependencies run: go get -v golang.org/x/lint/golint - name: Run Tests run: | golint -set_exit_status ./... go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./... - name: Upload coverage to Codecov if: success() && matrix.go == 1.17 && matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos