forked from google/go-github
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.88 KB
/
tests.yml
File metadata and controls
67 lines (58 loc) · 1.88 KB
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
59
60
61
62
63
64
65
66
67
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
branches:
- master
name: tests
env:
GO111MODULE: on
permissions:
contents: read
jobs:
test:
permissions:
contents: read
id-token: write
defaults:
run:
shell: bash
strategy:
matrix:
go-version: [stable, oldstable] # test with N and the .0 release of N-1
platform: [ubuntu-latest]
include:
# include windows, but only with the latest Go version, since there
# is very little in the library that is platform specific
- go-version: stable
platform: windows-latest
# only update test coverage stats with the most recent go version on linux
- go-version: stable
platform: ubuntu-latest
update-coverage: true
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "**/go.sum"
- name: Run go test
run: |
if [ -n "${{ matrix.update-coverage }}" ]; then
script/test.sh -race -covermode atomic -coverprofile coverage.txt ./...
exit
fi
script/test.sh -race -covermode atomic ./...
- name: Ensure integration tests build
# don't actually run tests since they hit live GitHub API
run: go test -v -tags=integration -run=^$ ./test/integration
- name: Upload coverage to Codecov
if: ${{ matrix.update-coverage }}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
use_oidc: true