Skip to content

Upgrade Django; Fix GH Actions; Chores #728

Upgrade Django; Fix GH Actions; Chores

Upgrade Django; Fix GH Actions; Chores #728

Workflow file for this run

name: test
on:
push:
# run on push to main branch
branches: [ main ]
paths-ignore:
- 'docs/**'
pull_request:
# run for pull requests against main
branches: [ main ]
paths-ignore:
- 'docs/**'
env:
DESECSTACK_DOMAIN: your.hostname.example.com
DESECSTACK_NS: ns1.example.com ns2.example.com
DESECSTACK_API_ADMIN: john.doe@example.com
DESECSTACK_API_AUTHACTION_VALIDITY: 24
DESECSTACK_API_SEPA_CREDITOR_ID: TESTCREDITORID
DESECSTACK_API_SEPA_CREDITOR_NAME: TESTCREDITORNAME
DESECSTACK_API_EMAIL_HOST: mail.your.hostname.example.com
DESECSTACK_API_EMAIL_HOST_USER: user
DESECSTACK_API_EMAIL_HOST_PASSWORD: password
DESECSTACK_API_EMAIL_PORT: 25
DESECSTACK_API_SECRETKEY: 9Fn33T5yGuds
DESECSTACK_API_PCH_API: http://pch
DESECSTACK_API_PCH_API_TOKEN: insecure
DESECSTACK_API_PSL_RESOLVER: 8.8.8.8
DESECSTACK_DBAPI_PASSWORD_desec: 9Fn33T5yGueeee
DESECSTACK_NSLORD_APIKEY: 9Fn33T5yGukjekwjew
DESECSTACK_NSLORD_DEFAULT_TTL: 1234
DESECSTACK_DBMASTER_PASSWORD_pdns: 9Fn33T5yGukjwelt
DESECSTACK_NSMASTER_ALSO_NOTIFY:
DESECSTACK_NSMASTER_APIKEY: LLq1orOQuXCINUz4TV
DESECSTACK_NSMASTER_TSIGKEY: +++undefined/undefined/undefined/undefined/undefined/undefined/undefined/undefined+++A==
DESECSTACK_IPV4_REAR_PREFIX16: 172.16
DESECSTACK_IPV6_SUBNET: bade:affe:dead:beef:b011::/80
DESECSTACK_IPV6_ADDRESS: bade:affe:dead:beef:b011:0642:ac10:0080
DESECSTACK_PORT_XFR: 12353
DESECSTACK_WWW_CERTS: ./certs
DESECSTACK_MINIMUM_TTL_DEFAULT: 3600
DESECSTACK_PROMETHEUS_PASSWORD: Je9NNkqbULsg
jobs:
test-black-format:
# tests if black formatting is used
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install black
run: python3 -m pip install black
- name: Test desecapi formatting
run: black --check api/
test-missing-migrations:
# test if Django migrations are missing
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build images
uses: ./.github/workflows/build
with:
images: api dbapi nslord nsmaster dblord dbmaster
- name: Check for missing migrations
run: docker-compose run -T api sh -c "./wait-dbapi && python manage.py makemigrations --check"
test-e2e2:
# runs e2e2 tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build images
uses: ./.github/workflows/build
- name: Run e2e2 Tests
run: docker-compose -f docker-compose.yml -f docker-compose.test-e2e2.yml run -T test-e2e2 sh -c "./apiwait 300 && python3 -m pytest -vv --skip-performance-tests ."
- name: e2e2 Tests Logs and Cleanup
if: always()
run: |
docker-compose -f docker-compose.yml -f docker-compose.test-e2e2.yml ps
grep 'desec/' /var/log/syslog
docker-compose -f docker-compose.yml -f docker-compose.test-e2e2.yml down -v
test-api:
# runs API tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build images
uses: ./.github/workflows/build
with:
images: api dbapi nslord nsmaster dblord dbmaster
- name: Run API Tests
run: docker-compose -f docker-compose.yml -f docker-compose.test-api.yml run -T api bash -c "./entrypoint-tests.sh"
- name: API Tests Logs and Cleanup
if: always()
run: |
docker-compose -f docker-compose.yml -f docker-compose.test-api.yml ps
grep 'desec/' /var/log/syslog
docker-compose -f docker-compose.yml -f docker-compose.test-api.yml down -v