2023-04-21 10:54:23 +00:00
|
|
|
name: "Setup authentik testing environment"
|
|
|
|
description: "Setup authentik testing environment"
|
2022-04-04 12:02:10 +00:00
|
|
|
|
2023-04-13 12:10:12 +00:00
|
|
|
inputs:
|
2023-11-23 22:59:42 +00:00
|
|
|
postgresql_version:
|
2023-04-13 12:10:12 +00:00
|
|
|
description: "Optional postgresql image tag"
|
2024-01-11 18:27:18 +00:00
|
|
|
default: "16"
|
2023-04-13 12:10:12 +00:00
|
|
|
|
2022-04-04 12:02:10 +00:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2023-11-18 23:33:37 +00:00
|
|
|
- name: Install poetry & deps
|
2022-04-04 12:02:10 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
pipx install poetry || true
|
2023-11-18 23:33:37 +00:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install --no-install-recommends -y libpq-dev openssl libxmlsec1-dev pkg-config gettext
|
2022-04-04 12:02:10 +00:00
|
|
|
- name: Setup python and restore poetry
|
2023-11-18 23:33:37 +00:00
|
|
|
uses: actions/setup-python@v4
|
2022-04-04 12:02:10 +00:00
|
|
|
with:
|
2024-01-11 18:27:18 +00:00
|
|
|
python-version-file: "pyproject.toml"
|
2023-04-21 10:54:23 +00:00
|
|
|
cache: "poetry"
|
2022-04-04 12:02:10 +00:00
|
|
|
- name: Setup node
|
2023-04-21 12:45:41 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-04-04 12:02:10 +00:00
|
|
|
with:
|
2023-11-18 23:33:37 +00:00
|
|
|
node-version-file: web/package.json
|
2023-04-21 10:54:23 +00:00
|
|
|
cache: "npm"
|
2022-04-04 12:02:10 +00:00
|
|
|
cache-dependency-path: web/package-lock.json
|
2023-11-18 23:33:37 +00:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version-file: "go.mod"
|
2022-04-04 12:02:10 +00:00
|
|
|
- name: Setup dependencies
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-11-23 22:59:42 +00:00
|
|
|
export PSQL_TAG=${{ inputs.postgresql_version }}
|
2022-04-04 12:02:10 +00:00
|
|
|
docker-compose -f .github/actions/setup/docker-compose.yml up -d
|
|
|
|
poetry install
|
2022-09-06 22:23:25 +00:00
|
|
|
cd web && npm ci
|
2022-04-04 12:02:10 +00:00
|
|
|
- name: Generate config
|
|
|
|
shell: poetry run python {0}
|
|
|
|
run: |
|
|
|
|
from authentik.lib.generators import generate_id
|
|
|
|
from yaml import safe_dump
|
|
|
|
|
|
|
|
with open("local.env.yml", "w") as _config:
|
|
|
|
safe_dump(
|
|
|
|
{
|
|
|
|
"log_level": "debug",
|
|
|
|
"secret_key": generate_id(),
|
|
|
|
},
|
|
|
|
_config,
|
|
|
|
default_flow_style=False,
|
|
|
|
)
|