-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (39 loc) · 1.14 KB
/
test.yml
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
# Thanks to:
# https://github.com/mvdan/github-actions-golang
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout package
uses: actions/checkout@v4
- name: Download credentials
run: |
echo "$GOOGLE_CLOUD_KEY" > gcloud-key.json
env:
GOOGLE_CLOUD_KEY: ${{ secrets.GOOGLE_CLOUD_KEY }}
- name: Test package
run: |
go test -v -coverprofile=coverage.out -covermode=count ./...
env:
GOOGLE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }}
GOOGLE_APPLICATION_CREDENTIALS: "${{ github.workspace }}/gcloud-key.json"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
flags: unittests