Skip to content

Commit

Permalink
add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoubfaouzi committed Jun 27, 2024
1 parent 993ea3e commit 16096de
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build-test

on: [push]

jobs:
test:
name: build-test
strategy:
fail-fast: false
matrix:
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: |
go env -w GOFLAGS=-mod=mod
go build -v ./...
- name: Test With Coverage
run: go test -race -coverprofile=coverage -covermode=atomic

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'

- name: Go vet
run: |
go vet .
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'

- name: Go Static Check
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck .
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'

0 comments on commit 16096de

Please sign in to comment.