mirror of
https://github.com/goauthentik/authentik.git
synced 2026-08-30 18:51:39 -07:00
96 lines
2.8 KiB
YAML
96 lines
2.8 KiB
YAML
---
|
|
name: CI - Outpost
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- next
|
|
- version-*
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- version-*
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
cancel-in-progress: "${{ !startsWith(github.ref, 'refs/heads/version-') && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/next' }}"
|
|
|
|
env:
|
|
POSTGRES_DB: authentik
|
|
POSTGRES_USER: authentik
|
|
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
|
|
|
|
jobs:
|
|
lint-golint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v5
|
|
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Prepare and generate API
|
|
run: |
|
|
# Create folder structure for go embeds
|
|
mkdir -p web/dist
|
|
mkdir -p website/help
|
|
touch web/dist/test website/help/test
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v8
|
|
with:
|
|
args: --timeout 5000s --verbose
|
|
skip-cache: true
|
|
test-unittest:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v5
|
|
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Setup authentik env
|
|
uses: ./.github/actions/setup
|
|
- name: prepare database
|
|
run: |
|
|
uv run make migrate
|
|
- name: Go unittests
|
|
run: |
|
|
go test -timeout 0 -v -race -coverprofile=coverage.out -covermode=atomic -cover ./...
|
|
ci-outpost-mark:
|
|
if: always()
|
|
needs:
|
|
- lint-golint
|
|
- test-unittest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # release/v1
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|
|
build-binary:
|
|
timeout-minutes: 120
|
|
needs:
|
|
- ci-outpost-mark
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
type:
|
|
- ldap
|
|
- radius
|
|
- rac
|
|
goos: [linux]
|
|
goarch: [amd64, arm64]
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v5
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Build outpost
|
|
run: |
|
|
set -x
|
|
export GOOS=${{ matrix.goos }}
|
|
export GOARCH=${{ matrix.goarch }}
|
|
export CGO_ENABLED=0
|
|
go build -tags=outpost_static_embed -v -o ./authentik-outpost-${{ matrix.type }}_${{ matrix.goos }}_${{ matrix.goarch }} ./cmd/${{ matrix.type }}
|