Skip to content

Commit 56a7b7c

Browse files
committed
chore: Update CI workflows
Simplify unit tests using matrix Drop go:build tags on ruler tests as they seem unneeded now Signed-off-by: Michael Gasch <[email protected]>
1 parent 23a9c12 commit 56a7b7c

File tree

8 files changed

+26
-63
lines changed

8 files changed

+26
-63
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Benchmarks
1313
strategy:
1414
matrix:
15-
go-version: ["1.18"]
15+
go-version: ["1.19"]
1616
platform: ["ubuntu-latest"]
1717

1818
runs-on: ${{ matrix.platform }}

.github/workflows/dep-review.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
dependency-review:
1212
strategy:
1313
matrix:
14-
go-version: ["1.18"]
14+
go-version: ["1.19"]
1515
platform: ["ubuntu-latest"]
1616
runs-on: ${{ matrix.platform }}
1717
timeout-minutes: 5

.github/workflows/go-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Code Linting
1313
strategy:
1414
matrix:
15-
go-version: ["1.18"]
15+
go-version: ["1.19"]
1616
platform: ["ubuntu-latest"]
1717
runs-on: ${{ matrix.platform }}
1818
timeout-minutes: 5

.github/workflows/go-unit-tests.yaml

Lines changed: 21 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ jobs:
1616
name: Unit Tests
1717
strategy:
1818
matrix:
19-
go-version: ["1.18"]
19+
go-version: ["1.19"]
2020
platform: ["ubuntu-latest"]
21+
type: ["Tests","Cover"] # run coverage as separate job w/out -race to avoid killing process
22+
include:
23+
- type: "Tests"
24+
goflags: '-v -race -count=1 -json'
25+
- type: "Cover"
26+
goflags: "-v -count=1 -json"
27+
coveropts: "-coverprofile=coverage.txt -covermode=atomic"
2128

2229
runs-on: ${{ matrix.platform }}
2330
timeout-minutes: 20
@@ -46,10 +53,21 @@ jobs:
4653
- name: Install tparse
4754
run: go install github.com/mfridman/tparse@latest
4855

56+
- name: Check for .codecov.yaml
57+
id: codecov-enabled
58+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b
59+
with:
60+
files: .codecov.yaml
61+
4962
- name: Test
5063
env:
51-
GOFLAGS: "-v -race -count=1 -json"
52-
run: go test ./... | tparse -all
64+
COVER_OPTS: ${{ matrix.coveropts }}
65+
GOFLAGS: ${{ matrix.goflags }}
66+
run: go test $COVER_OPTS ./... | tparse -all -notests -format markdown >> $GITHUB_STEP_SUMMARY
67+
68+
- if: steps.codecov-enabled.outputs.files_exists == 'true'
69+
name: Upload Codecov Report
70+
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
5371

5472
- name: Verify git clean
5573
shell: bash
@@ -61,55 +79,3 @@ jobs:
6179
echo "::error:: $(git status)"
6280
exit 1
6381
fi
64-
65-
# see https://github.com/timbray/quamina/issues/28 for details why a separate job
66-
coverage:
67-
name: Create Coverage Report
68-
strategy:
69-
matrix:
70-
go-version: ["1.18"]
71-
platform: ["ubuntu-latest"]
72-
73-
runs-on: ${{ matrix.platform }}
74-
timeout-minutes: 10
75-
76-
steps:
77-
- name: Checkout repository
78-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
79-
80-
- name: Set up Go ${{ matrix.go-version }}
81-
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
82-
with:
83-
go-version: ${{ matrix.go-version }}
84-
id: go
85-
86-
- name: Restore Go cache
87-
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12
88-
with:
89-
path: |
90-
~/.cache/go-build
91-
~/go/pkg/mod
92-
93-
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum', 'testdata/**') }}
94-
restore-keys: |
95-
${{ runner.os }}-go-${{ matrix.go-version }}-
96-
97-
- name: Install tparse
98-
run: go install github.com/mfridman/tparse@latest
99-
100-
- name: Check for .codecov.yaml
101-
id: codecov-enabled
102-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b
103-
with:
104-
files: .codecov.yaml
105-
106-
- if: steps.codecov-enabled.outputs.files_exists == 'true'
107-
name: Produce Go Coverage Report File
108-
env:
109-
COVER_OPTS: "-coverprofile=coverage.txt -covermode=atomic"
110-
GOFLAGS: "-v -count=1 -json"
111-
run: go test $COVER_OPTS ./... | tparse -all
112-
113-
- if: steps.codecov-enabled.outputs.files_exists == 'true'
114-
name: Upload Codecov Report
115-
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
timeout-minutes: 10
2020
strategy:
2121
matrix:
22-
go-version: ["1.18"]
22+
go-version: ["1.19"]
2323
platform: ["ubuntu-latest"]
2424
runs-on: ${{ matrix.platform }}
2525
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
22
.DS_Store
3+
coverage.txt

cl2_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build fromRuler
2-
31
package quamina
42

53
import (

generic_machine_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build fromRuler
2-
31
package quamina
42

53
import (

0 commit comments

Comments
 (0)