add workflows
This commit is contained in:
37
.github/workflows/build-and-test.yml
vendored
Normal file
37
.github/workflows/build-and-test.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: build_and_test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Update System
|
||||
run: |
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.25'
|
||||
|
||||
- name: Install Modules
|
||||
run: go mod tidy
|
||||
|
||||
- name: Test
|
||||
run: go test -coverprofile=coverage.txt -v ./...
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
#token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage.txt
|
||||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: true
|
||||
Reference in New Issue
Block a user