Skip to content

Commit

Permalink
Add github actions for testing and building
Browse files Browse the repository at this point in the history
  • Loading branch information
veqryn committed Nov 16, 2023
1 parent 97d1841 commit 3d58082
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Tests

on:
push:
tags:
branches:
pull_request:
branches:

jobs:

build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21' ]

steps:
- uses: actions/checkout@v3

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

- name: Display Go version
run: go version

- name: Install dependencies
run: |
go mod download
go get -t -u golang.org/x/tools/cmd/cover
- name: Build
run: go build -v ./...

- name: Test
run: go test -v -race -coverprofile=coverage.out -covermode=atomic

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 3d58082

Please sign in to comment.