-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.64 KB
/
Copy pathtests.yml
File metadata and controls
57 lines (53 loc) · 1.64 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
49
50
51
52
53
54
55
56
57
name: Tests
on: [push]
jobs:
tests:
permissions:
contents: read
strategy:
matrix:
env:
- os: ubuntu-latest
coverage: true
generate-check: true
- os: macos-latest
- os: windows-latest
continue-on-error: true
runs-on: ${{ matrix.env.os }}
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.25"
- uses: actions/checkout@v4
- name: Check if generated files are up to date
if: matrix.env.generate-check
run: |
# Run go generate
go generate ./...
# Check if any files were modified
if [ -n "$(git status --porcelain)" ]; then
echo "Generated files are out of date. Please run 'go generate ./...' and commit the changes."
git diff
exit 1
fi
- run: go vet ./...
- run: |
PREFIX="github.com/${GITHUB_REPOSITORY}"
go test -v \
${{ matrix.env.coverage && '-coverprofile=profile.cov' }} \
$(
go list ./... \
| grep -v "${PREFIX}/cmd" \
| grep -v "${PREFIX}/testvectors" \
| grep -v "${PREFIX}/pkg/cinodefs/protobuf" \
| grep -v "${PREFIX}/pkg/datastore/testutils/generate" \
)
continue-on-error: ${{ matrix.env['continue-on-error'] }}
- uses: shogo82148/actions-goveralls@v1
if: ${{ matrix.env.coverage }}
with:
path-to-profile: profile.cov
- uses: codecov/codecov-action@v5
if: ${{ matrix.env.coverage }}
with:
files: profile.cov