-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.29 KB
/
qa.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: QA & sanity checks
on:
push:
branches:
- main
tags:
- "*"
pull_request:
jobs:
quality:
name: Code sanity
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y curl ca-certificates git
- uses: actions/checkout@v4
- name: Go code sanity check
uses: canonical/desktop-engineering/gh-actions/go/code-sanity@main
with:
golangci-lint-configfile: ".golangci-ci.yaml"
tools-directory: "tools"
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: |
go test -coverpkg=./... -coverprofile=/tmp/coverage.tmp -covermode=count ./...
# Exclude testutils and generated files from the final coverage report
grep -hv -e "testutils" -e "_string\.go" /tmp/coverage.tmp > /tmp/coverage.out
- name: Run tests (with race detector)
run: |
go test -race ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: /tmp/coverage.out