-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (69 loc) · 2.83 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
on: push
name: Test
jobs:
test:
strategy:
matrix:
# support the current and previous major version of Go
go-version: [1.22.x, 1.23.x]
os:
- depot-ubuntu-24.04
# - macos-latest
# - windows-latest
runs-on: ${{ matrix.os }}
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 -d ./...
- 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
skip-cache: true # the linters require all code generation and dependecies to be present, but the cache implementation completely falls over when there is already existing content. See https://github.com/golangci/golangci-lint-action/issues/23, https://github.com/golangci/golangci-lint-action/issues/863, https://github.com/golangci/golangci-lint-action/issues/984
- 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/[email protected]
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_DOMAIN: ${{ secrets.OVERMIND_NTE_ALLPERMS_DOMAIN }}
OVERMIND_NTE_ALLPERMS_CLIENT_ID: ${{ secrets.OVERMIND_NTE_ALLPERMS_CLIENT_ID }}
OVERMIND_NTE_ALLPERMS_CLIENT_SECRET: ${{ secrets.OVERMIND_NTE_ALLPERMS_CLIENT_SECRET }}
- name: Show container logs for debugging
if: failure()
run: |
docker compose -f .github/docker-compose-services.yml logs
- name: Show container logs for archival
if: ${{ ! failure() }}
run: |
docker compose -f .github/docker-compose-services.yml logs