Merge pull request #2246 from fractal-analytics-platform/executor-cle… #2140
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
name: OAuth2-OIDC | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
test_oauth2_oidc: | |
name: OAuth2-OIDC | |
runs-on: ubuntu-22.04 | |
services: | |
dexidp: | |
image: ghcr.io/fractal-analytics-platform/oauth:0.1 | |
ports: | |
- 5556:5556 | |
mailpit: | |
image: axllent/mailpit | |
ports: | |
- 1025:1025 | |
- 8025:8025 | |
env: | |
MP_SMTP_AUTH: "sender@example.org:fakepassword" | |
MP_SMTP_AUTH_ALLOW_INSECURE: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Start Postgres | |
run: | | |
sudo systemctl start postgresql.service | |
sudo --login -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';" | |
sudo --login -u postgres createdb fractal_test | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install dependencies | |
run: pip install -e . | |
- name: Run Fractal | |
env: | |
FRACTAL_TASKS_DIR: /dev/fractal/task | |
FRACTAL_RUNNER_WORKING_BASE_DIR: /dev/fractal/base_dir | |
FRACTAL_RUNNER_BACKEND: local | |
JWT_SECRET_KEY: jwt_secret_key | |
JWT_EXPIRE_SECONDS: 1000 | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: fractal_test | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 5432 | |
# FRACTAL_EMAIL_SETTINGS and KEY are generated with the following command | |
# `printf "fakepassword\n" | poetry run fractalctl email-settings sender@example.org localhost 1025 test --skip-starttls` | |
FRACTAL_EMAIL_SETTINGS: gAAAAABnYvLgoSeECnrXlv1UoP4D_c9Of0xmwMJVopBA3TIDjOvx6YDVfe2ULz8yGr8Ba5Id8rRLjCXa_Ys8iHjvuniJyvsX0mDrc3IGSoofMEeeSCvYEe4iSWLeb_qTNVNPc4IT2-SLB-F7dEvkwzyAFnEm9dVmApd4_lQLm9_wJoS-tz1Q1K8E1_jJSgpfGgwHaINHICVh1UL_qHjIa3DwFvDPvt32tLLBZTL7oN88A8RCmg00ThIZs4HN7OQkvfninfOiM060Lb-AeNViCVgBX-bIPWZaeQ== | |
FRACTAL_EMAIL_SETTINGS_KEY: 4otDt3R-8p4S97QT0gcUzynCalByypTv01YntqQ9XFk= | |
FRACTAL_EMAIL_RECIPIENTS: recipient1@example.org,recipient2@example.org | |
OAUTH_DEXIDP_CLIENT_ID: client_test_id | |
OAUTH_DEXIDP_CLIENT_SECRET: client_test_secret | |
OAUTH_DEXIDP_REDIRECT_URL: http://localhost:8001/auth/dexidp/callback/ | |
OAUTH_DEXIDP_OIDC_CONFIGURATION_ENDPOINT: http://127.0.0.1:5556/dex/.well-known/openid-configuration | |
run: | | |
fractalctl set-db | |
fractalctl start --port 8001 & | |
sleep 2 | |
- name: Run OAuth2 script | |
env: | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
PGHOST: localhost | |
PGPORT: 5432 | |
PGDATABASE: fractal_test | |
run: bash -x scripts/oauth/oauth.sh |