-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (49 loc) · 1.23 KB
/
unit-test.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
46
47
48
49
50
name: unit-tests
on:
push:
branches:
- main
pull_request:
paths:
- '**'
jobs:
run:
runs-on: ubuntu-latest
environment: publish
permissions:
id-token: write
contents: read
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: ./
- name: Run Unit Tests for Templater
working-directory: config-templating
run: |
go test -v
- name: Run Unit Tests for GoPinotAPI
working-directory: ./
run: |
go test -v
calculate-coverage:
runs-on: ubuntu-latest
needs: run
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: ./
- name: Calculate Coverage for GoPinotAPI
working-directory: ./
run: |
go test -coverprofile=coverage.out
go tool cover -func=coverage.out
- name: Upload to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.out
force-coverage-parser: go