go.mway.dev/chrono@v0.6.1-0.20240126030049-189c5aef20d2/.github/workflows/go.yml (about) 1 name: Go 2 3 on: 4 push: 5 branches: [main, master] 6 tags: ["v*"] 7 pull_request: 8 branches: ["*"] 9 10 permissions: 11 contents: read 12 pull-requests: read 13 14 jobs: 15 build: 16 runs-on: ubuntu-latest 17 strategy: 18 matrix: 19 go: [1.20.x, 1.21.x] 20 include: 21 - go: 1.21.x 22 steps: 23 - name: Checkout code 24 uses: actions/checkout@v4 25 - name: Setup Go 26 uses: actions/setup-go@v4 27 with: 28 go-version: ${{ matrix.go }} 29 cache-dependency-path: "**/go.sum" 30 - name: Build 31 run: go build -v ./... 32 - name: Test 33 run: go test -v -race -coverprofile cover.out ./... 34 - name: Prepare Coverage 35 run: go tool cover -html=cover.out -o cover.html 36 - name: Upload Coverage 37 uses: codecov/codecov-action@v3 38 lint: 39 runs-on: ubuntu-latest 40 steps: 41 - name: Checkout code 42 uses: actions/checkout@v4 43 - name: Setup Go 44 uses: actions/setup-go@v4 45 with: 46 go-version: 1.21.x 47 cache-dependency-path: "**/go.sum" 48 - name: Lint 49 uses: golangci/golangci-lint-action@v3 50 with: 51 version: latest