| 1 |
name: 'Go' |
| 2 |
on: |
| 3 |
pull_request: |
| 4 |
branches: |
| 5 |
- 'master' |
| 6 |
push: |
| 7 |
branches: |
| 8 |
- 'master' |
| 9 |
merge_group: |
| 10 |
branches: |
| 11 |
- 'master' |
| 12 |
permissions: |
| 13 |
contents: 'read' |
| 14 |
jobs: |
| 15 |
cover: |
| 16 |
name: 'Coverage' |
| 17 |
runs-on: 'ubuntu-latest' |
| 18 |
steps: |
| 19 |
- name: 'Harden Runner' |
| 20 |
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 |
| 21 |
with: |
| 22 |
egress-policy: 'audit' |
| 23 |
- name: 'Set up Go' |
| 24 |
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 |
| 25 |
with: |
| 26 |
go-version: '1.26' |
| 27 |
- name: 'Checkout' |
| 28 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 29 |
- name: 'Get Dependencies' |
| 30 |
run: | |
| 31 |
go get -v -t ./... |
| 32 |
- name: 'Test' |
| 33 |
run: | |
| 34 |
go test -coverprofile=coverage.txt -v ./... |
| 35 |
- name: 'Coverage' |
| 36 |
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 |
| 37 |
with: |
| 38 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 39 |
build: |
| 40 |
name: 'Build and Test' |
| 41 |
runs-on: 'ubuntu-latest' |
| 42 |
strategy: |
| 43 |
matrix: |
| 44 |
go: |
| 45 |
- '1.25' |
| 46 |
- '1.26' |
| 47 |
fail-fast: false |
| 48 |
steps: |
| 49 |
- name: 'Harden Runner' |
| 50 |
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 |
| 51 |
with: |
| 52 |
egress-policy: 'audit' |
| 53 |
- name: 'Set up Go ${{ matrix.go }}' |
| 54 |
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 |
| 55 |
with: |
| 56 |
go-version: ${{ matrix.go }} |
| 57 |
- name: 'Checkout' |
| 58 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 59 |
- name: 'Get Dependencies' |
| 60 |
run: | |
| 61 |
go get -v -t ./... |
| 62 |
- name: 'Build' |
| 63 |
run: | |
| 64 |
go build -v ./... |
| 65 |
- name: 'Test' |
| 66 |
run: | |
| 67 |
go test -v ./... |