krz/devianter

A DeviantArt guest API library for Go.

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

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

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