Skip to content

Commit 08ae003

Browse files
Merge pull request #191 from hashicorp/build-test
IND-2336 ci.yml updated with unit test coverage, .go-version added
2 parents 5ae5436 + b9f15d4 commit 08ae003

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: build
22

33
on:
44
push:
5-
branches:
6-
tags:
5+
branches: [main]
6+
tags: ["*"]
77
pull_request:
8+
branches: [main]
89

910
jobs:
1011
build:
@@ -20,9 +21,9 @@ jobs:
2021
- name: checkout
2122
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
2223

23-
- name: build and test
24+
- name: build, test and generate coverage report
2425
run: |
25-
go test -timeout=60s -race ./...
26+
go test -timeout=60s -race -v ./... -coverprofile=coverage.out
2627
go build -race ./...
2728
2829
- name: build and test ARC
@@ -31,6 +32,15 @@ jobs:
3132
go test -timeout=60s -race
3233
go build -race
3334
35+
- name: Upload the coverage report
36+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
37+
with:
38+
path: coverage.out
39+
name: Coverage-report
40+
41+
- name: Display the coverage report
42+
run: go tool cover -func=coverage.out
43+
3444
- name: install golangci-lint
3545
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.53.3
3646

.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.19

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/hashicorp/golang-lru/v2
22

3-
go 1.18
3+
go 1.19

0 commit comments

Comments
 (0)