forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 1.55 KB
/
test_template.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
40
41
42
43
44
45
46
47
48
49
on:
workflow_call:
inputs:
modulepath:
required: true
type: string
tests-timeout:
required: true
type: string
go-version:
required: true
type: string
secrets:
codecov-token:
required: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Go test
run: go test -coverprofile coverage.out -covermode=atomic -timeout ${{ inputs.tests-timeout }} -v ./...
working-directory: ${{ inputs.modulepath }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.codecov-token }}
verbose: true
fail_ci_if_error: true
flags: ${{ inputs.modulepath }}
# TODO: We have to fix race conditions before running this job
# test-with-race:
# runs-on: ubuntu-latest
# steps:
# - name: Install Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ inputs.go-version }}
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Go race test
# run: go test -race -timeout ${{ inputs.tests-timeout }} ./...
# working-directory: ${{ inputs.modulepath }}