-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (39 loc) · 1.33 KB
/
test.yml
File metadata and controls
48 lines (39 loc) · 1.33 KB
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
# SPDX-FileCopyrightText: Copyright 2026 Stacklok, Inc.
# SPDX-License-Identifier: Apache-2.0
name: Test
on:
workflow_call:
permissions:
contents: read
jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 'stable'
cache: true
cache-dependency-path: go.sum
- name: Download Go dependencies
run: |
go mod download
go mod verify
- name: Cache Go build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
# TODO: Enable after provisioning Codecov
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./coverage.out
# fail_ci_if_error: false