chore: add coverage report #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: Codebase test | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Run Go Test | |
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... | |
- name: Check Test Coverage | |
uses: vladopajic/go-test-coverage@v2 | |
with: | |
config: ./.testcoverage.yml | |
end-to-end: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Spin up container to run e2e | |
run: docker-compose -f docker-compose.prod.yml up -d --build | |
- name: Download k6 binary | |
run: | | |
wget https://github.com/grafana/k6/releases/download/v0.49.0/k6-v0.49.0-linux-amd64.deb | |
- name: Install k6 | |
run: | | |
sudo dpkg -i k6-v0.49.0-linux-amd64.deb | |
- name: Resolve Debian dependencies | |
run: sudo apt-get install -f | |
- name: Verify installation | |
run: k6 version | |
- name: Run k6 e2e test | |
run: k6 run testing/k6/end_to_end_test.js | |
- name: Remove container | |
run: docker-compose -f docker-compose.prod.yml down | |