fix: tests on github
This commit is contained in:
parent
f1cb455ccd
commit
f67dfb3245
2 changed files with 24 additions and 3 deletions
14
.github/workflows/int_gateway-int.yml
vendored
14
.github/workflows/int_gateway-int.yml
vendored
|
|
@ -18,6 +18,7 @@ concurrency:
|
|||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
environment: Production
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
|
|
@ -41,10 +42,19 @@ jobs:
|
|||
pip install -r requirements.txt --no-cache-dir
|
||||
fi
|
||||
|
||||
- name: Verify CONFIG_KEY for pytest
|
||||
env:
|
||||
CONFIG_KEY: ${{ secrets.CONFIG_KEY }}
|
||||
run: |
|
||||
if [ -z "${CONFIG_KEY}" ]; then
|
||||
echo "::error::CONFIG_KEY is empty in GitHub Environment 'Production'. Add the int master key as CONFIG_KEY there (must decrypt INT_ENC:* in env-gateway-int.env)."
|
||||
exit 1
|
||||
fi
|
||||
echo "CONFIG_KEY is set (${#CONFIG_KEY} characters)."
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
# env-gateway-int.env: APP_KEY_SYSVAR=CONFIG_KEY — int master key for INT_ENC:* secrets
|
||||
CONFIG_KEY: ${{ secrets.CONFIG_KEY_INT }}
|
||||
CONFIG_KEY: ${{ secrets.CONFIG_KEY }}
|
||||
run: python -m pytest tests/ --ignore=tests/demo
|
||||
|
||||
build:
|
||||
|
|
|
|||
13
.github/workflows/main_gateway-prod.yml
vendored
13
.github/workflows/main_gateway-prod.yml
vendored
|
|
@ -18,6 +18,8 @@ concurrency:
|
|||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
# Same GitHub Environment as deploy — CONFIG_KEY lives here (not on the build job).
|
||||
environment: Production
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
|
|
@ -41,9 +43,18 @@ jobs:
|
|||
pip install -r requirements.txt --no-cache-dir
|
||||
fi
|
||||
|
||||
- name: Verify CONFIG_KEY for pytest
|
||||
env:
|
||||
CONFIG_KEY: ${{ secrets.CONFIG_KEY }}
|
||||
run: |
|
||||
if [ -z "${CONFIG_KEY}" ]; then
|
||||
echo "::error::CONFIG_KEY is empty in GitHub Environment 'Production'. Azure App Service settings are not visible to this job — add CONFIG_KEY under Settings → Environments → Production → Environment secrets (same value as in Azure portal)."
|
||||
exit 1
|
||||
fi
|
||||
echo "CONFIG_KEY is set (${#CONFIG_KEY} characters)."
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
# env-gateway-prod.env: APP_KEY_SYSVAR=CONFIG_KEY — prod master key for PROD_ENC:* secrets
|
||||
CONFIG_KEY: ${{ secrets.CONFIG_KEY }}
|
||||
run: python -m pytest tests/ --ignore=tests/demo
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue