Skip to content

Commit 18d613b

Browse files
authored
Merge pull request #18 from Pix4D/pci-1696-terravalet-opensourced
Add github actions workflow
2 parents e203340 + 25ea3c7 commit 18d613b

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# based on https://github.com/marco-m/timeit/blob/master/.github/workflows/ci.yml
2+
3+
on: [push]
4+
name: CI
5+
jobs:
6+
all:
7+
strategy:
8+
matrix:
9+
go-version: [1.17.x]
10+
os: [ubuntu-latest]
11+
task-version: [v3.7.0]
12+
gotestsum-version: [v1.7.0]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- name: Install Go ${{ matrix.go-version }}
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: ${{ matrix.go-version }}
19+
- name: Install task ${{ matrix.task-version }}
20+
run: go install github.com/go-task/task/v3/cmd/task@${{ matrix.task-version }}
21+
- name: Install gotestsum ${{ matrix.gotestsum-version }}
22+
run: go install gotest.tools/gotestsum@${{ matrix.gotestsum-version }}
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
with:
26+
# By default, actions/checkout will persist the GITHUB_TOKEN, so that further
27+
# steps in the job can perform authenticated git commands (that is: WRITE to
28+
# the repo). Following the Principle of least privilege, we disable this as long
29+
# as we don't need it.
30+
persist-credentials: false
31+
- name: Go lint
32+
run: task lint
33+
- name: Terravalet tests
34+
run: task test

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Changes
1717

18-
- Bump go to latest v1.16
18+
- Bump go to latest v1.17
1919

2020
## [v0.6.0] - (2021-08-11)
2121

Taskfile.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ tasks:
77

88
default:
99
deps: [test]
10+
11+
install-deps:
12+
desc: Install tool dependencies.
13+
deps:
14+
- install-lint
15+
16+
lint:
17+
desc: Lint Terravalet
18+
deps:
19+
- install-deps
20+
cmds:
21+
# --enable actually adds to the default linters
22+
- golangci-lint run --enable gofmt,gocritic ./...
1023

1124
build:
1225
desc: Build the terravalet executable
@@ -99,3 +112,16 @@ tasks:
99112
GOOS: darwin
100113
GOARCH: amd64
101114
vars: *build-vars
115+
116+
install-lint:
117+
desc: low-level for CI optimization only
118+
dir: /tmp
119+
cmds:
120+
- curl -L {{.GOLANGCI_URL}} -o golangci-lint.tar.gz
121+
- tar xzf golangci-lint.tar.gz
122+
- cp golangci-lint-{{.GOLANGCI_VERSION}}-linux-amd64/golangci-lint {{.BINDIR}}/golangci-lint
123+
- rm -r golangci-lint*
124+
vars:
125+
GOLANGCI_VERSION: 1.42.0
126+
BINDIR: '{{default (print .HOME "/go") .GOPATH}}/bin'
127+
GOLANGCI_URL: https://github.com/golangci/golangci-lint/releases/download/v{{.GOLANGCI_VERSION}}/golangci-lint-{{.GOLANGCI_VERSION}}-{{OS}}-{{ARCH}}.tar.gz

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/pix4d/terravalet
22

3-
go 1.16
3+
go 1.17
44

55
require (
66
github.com/dexyk/stringosim v0.0.0-20170922105913-9d0b3e91a842

0 commit comments

Comments
 (0)