Skip to content

Commit a1e315b

Browse files
authored
Feat/#1/sequence collections (#2)
* #1 - all Sequence tests applied to CmpSequence * #1 - covered `Ordered` test cases * #1 - covered `OrderedMutable` test cases * #1 - renamed `Ordered` collections to `Cmp` * #1 - cleanup `CmpSequence` * #1 - codeconv config extracted * #1 - updated golangci linter pipeline * #1 - updated golangci linter pipeline * #1 - extracted internal functions to separate file; fixed linter issues * #1 - fix codecov pipeline
1 parent 23552f5 commit a1e315b

21 files changed

+1431
-1937
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Master Test Coverage
2+
3+
on:
4+
schedule:
5+
- cron: 0 8 * * *
6+
push:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
inputs: {}
10+
11+
jobs:
12+
report-coverage:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.24'
23+
24+
- name: Create var directory
25+
run: mkdir -p var
26+
27+
- name: Run tests with coverage
28+
run: |
29+
go test -race -coverprofile=var/coverage.txt -covermode=atomic ./...
30+
go tool cover -func=var/coverage.txt
31+
32+
- name: Upload coverage reports to Codecov
33+
uses: codecov/codecov-action@v5
34+
with:
35+
files: ./var/coverage.txt
36+
fail_ci_if_error: true
37+
token: ${{ secrets.CODECOV_TOKEN }}
38+
39+
- name: Run linter
40+
uses: golangci/golangci-lint-action@v6

.github/workflows/pull-request.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@ jobs:
1515
with:
1616
go-version: '1.24'
1717

18-
- name: Run tests
19-
run: go test ./...
18+
- name: Create var directory
19+
run: mkdir -p var
20+
21+
- name: Run tests with coverage
22+
run: |
23+
go test -race -coverprofile=var/coverage.txt -covermode=atomic ./...
24+
go tool cover -func=var/coverage.txt
25+
26+
- name: Upload coverage reports to Codecov
27+
uses: codecov/codecov-action@v5
28+
with:
29+
files: ./var/coverage.txt
30+
fail_ci_if_error: true
31+
token: ${{ secrets.CODECOV_TOKEN }}
2032

2133
- name: Run linter
22-
run: golangci-lint run
34+
uses: golangci/golangci-lint-action@v6

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ go.work.sum
2323

2424
# env file
2525
.env
26+
27+
# var directory
28+
var/

Taskfile.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: '3'
2+
3+
tasks:
4+
test:
5+
desc: Run tests
6+
cmds:
7+
- go test -race ./...
8+
9+
coverage:
10+
desc: Generate coverage report and display summary
11+
cmds:
12+
- mkdir -p var
13+
- go test -race -coverprofile=var/coverage.txt -covermode=atomic ./...
14+
- go tool cover -func=var/coverage.txt
15+
16+
coverage:html:
17+
desc: Generate HTML coverage report
18+
deps: [coverage]
19+
cmds:
20+
- go tool cover -html=var/coverage.txt -o var/coverage.html
21+
- echo "Coverage report generated at var/coverage.html"
22+
23+
lint:
24+
desc: Run linter
25+
cmds:
26+
- golangci-lint run
27+
28+
clean:
29+
desc: Clean up generated files
30+
cmds:
31+
- rm -rf var/
32+
33+
ci:
34+
desc: Run all CI checks
35+
cmds:
36+
- task: test
37+
- task: coverage
38+
- golangci-lint run

0 commit comments

Comments
 (0)