-
-
Notifications
You must be signed in to change notification settings - Fork 3
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
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@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
misspell:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
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 .