File: ci.yml

package info (click to toggle)
golang-github-jarcoal-httpmock 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 344 kB
  • sloc: makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,496 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build

on:
  push:
    branches: [ v1 ]
  pull_request:
    branches: [ v1 ]
  workflow_dispatch:

jobs:
  test:
    strategy:
      matrix:
        go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x, 1.24.x, tip]
        full-tests: [false]
        include:
          - go-version: 1.25.x
            full-tests: true

    runs-on: ubuntu-latest

    steps:
      - name: Setup go
        run: |
          curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.7/install-go.pl |
              perl - ${{ matrix.go-version }} $HOME/go

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Linting
        if: matrix.full-tests
        run: |
          curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
              sh -s -- -b $HOME/go/bin v2.4.0
          $HOME/go/bin/golangci-lint run

      - name: Testing
        continue-on-error: ${{ matrix.go-version == 'tip' }}
        run: |
          go version
          if [ ${{ matrix.full-tests }} = true ]; then
              GO_TEST_OPTS="-covermode=atomic -coverprofile=coverage.out"
          fi
          export GORACE="halt_on_error=1"
          go test -race $GO_TEST_OPTS ./...

      - name: Reporting
        if: matrix.full-tests
        env:
          COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          go install github.com/mattn/goveralls@v0.0.11
          goveralls -coverprofile=coverage.out -service=github