Skip to content

Commit 7d781ab

Browse files
author
hgouchet
committed
Travis is deprecated, github actions is now used
1 parent 2455c9a commit 7d781ab

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/go-build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- main
6+
pull_request:
7+
branches:
8+
- master
9+
- main
10+
11+
name: build
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 2
19+
- uses: actions/setup-go@v3
20+
with:
21+
go-version: '1.21'
22+
- name: Run coverage
23+
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
24+
- name: Upload coverage to Codecov
25+
run: bash <(curl -s https://codecov.io/bash)
26+
test:
27+
strategy:
28+
matrix:
29+
go-version: [1.20.x, 1.21.x]
30+
platform: [ubuntu-latest, macos-latest, windows-latest]
31+
runs-on: ${{ matrix.platform }}
32+
steps:
33+
- name: Install Go
34+
if: success()
35+
uses: actions/setup-go@v3
36+
with:
37+
go-version: ${{ matrix.go-version }}
38+
- name: Checkout code
39+
uses: actions/checkout@v3
40+
- name: Run tests
41+
run: go test -v -covermode=count ./...
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: golangci-lint
17+
uses: golangci/golangci-lint-action@v2
18+
with:
19+
version: v1.54.2
20+
21+
# Optional: working directory, useful for monorepos
22+
# working-directory: somedir
23+
24+
# Optional: golangci-lint command line arguments.
25+
# args: --issues-exit-code=0
26+
27+
# Optional: show only new issues if it's a pull request. The default value is `false`.
28+
# only-new-issues: true
29+
30+
# Optional: if set to true then the action will use pre-installed Go.
31+
# skip-go-installation: true
32+
33+
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
34+
# skip-pkg-cache: true
35+
36+
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
37+
# skip-build-cache: true

0 commit comments

Comments
 (0)