Merge pull request #346 from overmindtech/renovate/opentelemetry-go #1397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |