Skip to content

Commit

Permalink
Try my new CI workflow (#46)
Browse files Browse the repository at this point in the history
* Try the workflow

* Omit the name

* Put the name back

* Nudge

* Nudge

* Does disabling fuzz work

* -v test flag

* Nudge

* Nudge

* Nudge

* Use v1
  • Loading branch information
FollowTheProcess authored Jan 8, 2025
1 parent 85718b2 commit 35af10f
Showing 1 changed file with 3 additions and 146 deletions.
149 changes: 3 additions & 146 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,151 +13,8 @@ concurrency:
permissions: {}

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
ci:
name: CI
permissions:
contents: read
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run Tests
run: go test -race ./...

cov:
name: CodeCov
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run Tests
run: go test -race -cover -covermode=atomic -coverprofile=./coverage.out ./...

- name: Coverage
uses: codecov/codecov-action@v5
with:
files: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}

fuzz-matrix:
name: Make Fuzz Matrix
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Set Fuzz Matrix
id: set-matrix
shell: bash
run: |
MATRIX=$(go test -list ^Fuzz -run ^$ | grep '^Fuzz' | jq --raw-input --slurp --compact-output 'split("\n") | map(select(length > 0))')
echo "matrix=$MATRIX"
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
fuzz:
name: Fuzz
runs-on: ubuntu-latest
needs:
- fuzz-matrix
strategy:
matrix:
fuzz-target: ${{ fromJSON(needs.fuzz-matrix.outputs.matrix) }}

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run Fuzz Tests
run: go test -fuzz "^${{ matrix.fuzz-target }}$" -fuzztime 1m

lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run Linting
uses: golangci/golangci-lint-action@v6
with:
version: latest

vulncheck:
name: Vulncheck
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run govulncheck
run: govulncheck ./...

typos:
name: Typos
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Check for Typos
uses: crate-ci/typos@v1.29.4
uses: FollowTheProcess/ci/.github/workflows/Go.yml@v1

0 comments on commit 35af10f

Please sign in to comment.