-
-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (45 loc) · 1.7 KB
/
ci.yml
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
55
56
57
58
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions: {}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["oldstable", "stable"] # supports two most recent Go versions
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ${{ matrix.go }}
- name: Test using predecessor Go version
if: matrix.go == 'oldstable'
run: go test -cover ./...
- name: Test using latest Go version
if: matrix.go == 'stable'
run: go test -v -cover -coverprofile=coverage.coverprofile ./...
- name: Upload coverage reports to Codecov
if: matrix.go == 'stable' # only sent the converage reports when using latest Go version
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
misspell:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: stable
- name: Set up misspell
run: go install github.com/client9/misspell/cmd/misspell@b90dc15cfd220ecf8bbc9043ecb928cef381f011 # v0.3.4
- name: Test misspelled words
run: misspell -error .