-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (60 loc) · 2.03 KB
/
ci-workflow.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
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
name: Astrolib Continuous Integration
on:
push:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.23
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.60.3
args: --verbose
test:
strategy:
matrix:
go-version: [1.23]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env:
COVER_DIR: ${{ github.workspace }}/coverage
COVER_FILE: coverage.out
COVER_OUT_PATH: ${{ github.workspace }}/coverage/coverage.out
COVER_HTML_PATH: ${{ github.workspace }}/coverage/coverage.html
GINKGO_REPORT: ginkgo.report
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Install ginkgo
run: go install github.com/onsi/ginkgo/v2/ginkgo@v2.20.2
- name: Checkout code
uses: actions/checkout@v4
- name: Ensure coverage directory exists
run: |
mkdir -p ${{ github.workspace }}/coverage
- name: Run tests and generate coverage profile with Ginkgo
run: |
ginkgo run -r -json-report {{env.GINKGO_REPORT}} -coverpkg=./... -coverprofile=coverage.out
- name: Apply coverage exclusions
run: |
${{ github.workspace }}/scripts/apply-coverage-exclusions.sh
- name: Check coverage directory contents
run: |
echo "Contents of ${{ github.workspace }}/coverage:"
ls -la ${{ github.workspace }}/coverage
- name: Generate HTML coverage report
run: |
go tool cover -html=coverage.out -o ${{ github.workspace }}/coverage/coverage.html
- name: Upload coverage to Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out