mirror of
https://github.com/google/go-github.git
synced 2026-10-28 16:34:37 +08:00
70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.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@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
with:
|
|
use_oidc: true
|