-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.18 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: ci
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: asdf-vm/actions/setup@v1
# TODO add this to a hack script (with any other plugins that aren't part of the standard library)
- run: asdf plugin add golangci-lint https://github.com/hypnoglow/asdf-golangci-lint.git
- uses: asdf-vm/actions/install@v1
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-1
# https://unix.stackexchange.com/questions/98435/using-awk-to-split-a-line-on-single-spaces-not-multiples
- run: asdf current golang | tee /dev/stderr | awk '{ print "GO_VERSION="$2 }' > $GITHUB_ENV
- uses: actions/cache@v2
with:
path: |
~/.asdf/installs/golang/${{env.GO_VERSION}}/go
~/.cache/go-build
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}
restore-keys: |
{{`${{runner.os}}`}}-go-
- run: go test ./...
- run: golangci-lint run ./...