krz/devianter

A DeviantArt guest API library for Go.

clone: git clone https://gitbay.org/krz/devianter.git

v0.3.1: .github/workflows/ci.yml · raw

 1name: CI
 2
 3on:
 4  push:
 5    branches:
 6      - main
 7  pull_request:
 8    branches:
 9      - main
10
11jobs:
12  test:
13    name: Test
14    runs-on: ubuntu-latest
15    strategy:
16      matrix:
17        go-version: ['1.18', '1.21']
18    steps:
19      - uses: actions/checkout@v7
20
21      - name: Set up Go
22        uses: actions/setup-go@v6
23        with:
24          go-version: ${{ matrix.go-version }}
25
26      - name: Cache Go modules
27        uses: actions/cache@v6
28        with:
29          path: ~/go/pkg/mod
30          key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
31          restore-keys: |
32            ${{ runner.os }}-go-${{ matrix.go-version }}-
33
34      - name: Download dependencies
35        run: go mod download
36
37      - name: Run tests
38        run: go test -v -race -coverprofile=coverage.out ./...
39
40      - name: Upload coverage
41        uses: codecov/codecov-action@v7
42        with:
43          files: ./coverage.out
44          flags: unittests
45          name: codecov-umbrella
46
47  lint:
48    name: Lint
49    runs-on: ubuntu-latest
50    steps:
51      - uses: actions/checkout@v7
52
53      - name: Set up Go
54        uses: actions/setup-go@v6
55        with:
56          go-version: '1.21'
57
58      - name: golangci-lint
59        uses: golangci/golangci-lint-action@v9
60        with:
61          version: latest
62          args: --timeout=5m
63
64  build:
65    name: Build
66    runs-on: ubuntu-latest
67    needs: [test, lint]
68    steps:
69      - uses: actions/checkout@v7
70
71      - name: Set up Go
72        uses: actions/setup-go@v6
73        with:
74          go-version: '1.21'
75
76      - name: Build
77        run: go build -v ./...
78
79      - name: Verify module
80        run: go mod verify