68 lines
1.8 KiB
YAML
Vendored
68 lines
1.8 KiB
YAML
Vendored
name: 'Go'
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
merge_group:
|
|
branches:
|
|
- 'master'
|
|
permissions:
|
|
contents: 'read'
|
|
jobs:
|
|
cover:
|
|
name: 'Coverage'
|
|
runs-on: 'ubuntu-latest'
|
|
steps:
|
|
- name: 'Harden Runner'
|
|
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
|
|
with:
|
|
egress-policy: 'audit'
|
|
- name: 'Set up Go'
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: '1.26'
|
|
- name: 'Checkout'
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: 'Get Dependencies'
|
|
run: |
|
|
go get -v -t ./...
|
|
- name: 'Test'
|
|
run: |
|
|
go test -coverprofile=coverage.txt -v ./...
|
|
- name: 'Coverage'
|
|
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
build:
|
|
name: 'Build and Test'
|
|
runs-on: 'ubuntu-latest'
|
|
strategy:
|
|
matrix:
|
|
go:
|
|
- '1.25'
|
|
- '1.26'
|
|
fail-fast: false
|
|
steps:
|
|
- name: 'Harden Runner'
|
|
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
|
|
with:
|
|
egress-policy: 'audit'
|
|
- name: 'Set up Go ${{ matrix.go }}'
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
- name: 'Checkout'
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: 'Get Dependencies'
|
|
run: |
|
|
go get -v -t ./...
|
|
- name: 'Build'
|
|
run: |
|
|
go build -v ./...
|
|
- name: 'Test'
|
|
run: |
|
|
go test -race -v ./...
|