-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (63 loc) · 1.67 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# SPDX-FileCopyrightText: 2023 Steffen Vogel <[email protected]>
# SPDX-License-Identifier: Apache-2.0
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
CGO_ENABLED: '0'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get install -y
libsodium-dev
libclang-dev
pkg-config
cmake
ninja-build
- name: Install rosenpass from git
uses: baptiste0928/cargo-install@v3
with:
crate: rosenpass
git: https://github.com/rosenpass/rosenpass
tag: v0.2.2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run Go tests
run: |
set -euo pipefail
sudo --preserve-env \
env "PATH=$PATH" \
go test \
-v \
-json \
-coverpkg ./... \
-coverprofile cover.profile \
./... 2>&1 | \
tee /tmp/gotest.log | \
gotestfmt
- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
- name: Report integration test coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: cover.profile