-
Notifications
You must be signed in to change notification settings - Fork 32
48 lines (40 loc) · 1.32 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
on:
push:
branches:
- master
name: CI
permissions: read-all
jobs:
test:
env:
GITHUB_API: ${{ secrets.PAT }}
## We want to define a strategy for our job
strategy:
## this will contain a matrix of all the combinations
## we wish to test again:
matrix:
go-version: [ 1.22.x ]
platform: [ ubuntu-latest, macos-latest, windows-latest ]
## Defines the platform for each test run
runs-on: ${{ matrix.platform }}
## the steps that will be run through for each version and platform
## combination
steps:
## sets up go based on the version
- name: Install Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: ${{ matrix.go-version }}
## checks out our code locally, so we can work with the files
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
## runs go test ./...
- name: Build
run: go build ./...
## runs go test ./...
- name: Test
run: go test ./... -coverprofile=./cover.out
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@cb6530fbecd68d5f1ee7a3dcd113450ea8d5d6d4 # v5.1.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}