-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.39 KB
/
test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
on: push
jobs:
test:
name: test
runs-on: depot-ubuntu-22.04-8
strategy:
matrix:
# for now only support 1.22 for loopvar change
go-version: [1.22.x]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # also fetch tags and branches for `git describe`
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Get dependencies
run: |
go get -v -t ./...
- name: Go Generate
run: go generate ./...
- name: Go vet
run: go vet ./...
# get .golangci.yml from github.com/overmindtech/golangci-lint_config
- name: Get .golangci.yml from github.com/overmindtech/golangci-lint_configs
run: |
curl -sfL https://raw.githubusercontent.com/overmindtech/golangci-lint_config/main/.golangci.yml -o .golangci.yml
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.1
args: --timeout 3m
- name: re-export environment
run: |
grep -h '^[^#]' .github/env/*.env | sort -u | tee -a "${GITHUB_ENV}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Compose Action
uses: hoverkraft-tech/compose-action@v2.0.2
with:
compose-file: ".github/docker-compose-services.yml"
env:
HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY }}
- name: Test
run: go test ./... -race -timeout 2m
env:
API_SERVER_AUDIENCE: ${{ vars.API_SERVER_AUDIENCE }}
OVERMIND_NTE_ALLPERMS_CLIENT_ID: ${{ secrets.OVERMIND_NTE_ALLPERMS_CLIENT_ID }}
OVERMIND_NTE_ALLPERMS_CLIENT_SECRET: ${{ secrets.OVERMIND_NTE_ALLPERMS_CLIENT_SECRET }}
OVERMIND_NTE_ALLPERMS_DOMAIN: ${{ secrets.OVERMIND_NTE_ALLPERMS_DOMAIN }}
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- test
steps:
# Creates a release and attaches
- name: Create Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}