-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from open-formulieren/feature/refactor-ci
Refactor CI to not use the OF test docker images
- Loading branch information
Showing
6 changed files
with
61 additions
and
101 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,20 +17,71 @@ jobs: | |
tests: | ||
name: Run the Django test suite | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:14 | ||
env: | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
ports: | ||
- 5432:5432 | ||
# Needed because the postgres container does not provide a healthcheck | ||
options: | ||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
--name postgres | ||
redis: | ||
image: redis:6 | ||
ports: | ||
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout Open Forms | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: open-formulieren/open-forms | ||
path: open-forms | ||
|
||
- name: Build test docker image | ||
- name: Checkout Token Exchange extension | ||
uses: actions/checkout@v3 | ||
with: | ||
path: extension | ||
|
||
- name: Set up backend environment | ||
uses: maykinmedia/[email protected] | ||
with: | ||
apt-packages: 'libxml2-dev libxmlsec1-dev libxmlsec1-openssl gettext postgresql-client gdal-bin' | ||
python-version: '3.10' | ||
optimize-postgres: 'yes' | ||
pg-service: 'postgres' | ||
setup-node: 'yes' | ||
nvmrc-custom-dir: 'open-forms' | ||
npm-ci-flags: '--legacy-peer-deps' | ||
working-directory: ${{ github.workspace }}/open-forms | ||
|
||
- name: Make symlink in OF to the extension | ||
run: | | ||
docker build . \ | ||
--tag $IMAGE_NAME:test \ | ||
--file ./ci/Dockerfile | ||
ln -s ${{ github.workspace }}/extension/token_exchange ${{ github.workspace }}/open-forms/src | ||
- name: Run tests | ||
run: | | ||
docker-compose -f docker-compose.ci.yml up -d | ||
working-directory: ci | ||
export OPEN_FORMS_EXTENSIONS=token_exchange | ||
python src/manage.py compilemessages | ||
coverage run --source=token_exchange src/manage.py test token_exchange | ||
coverage combine | ||
coverage xml -o coverage-extension.xml | ||
env: | ||
DJANGO_SETTINGS_MODULE: openforms.conf.ci | ||
SECRET_KEY: dummy | ||
DB_USER: postgres | ||
DB_PASSWORD: '' | ||
working-directory: ${{ github.workspace }}/open-forms | ||
|
||
- name: Publish coverage report | ||
uses: codecov/[email protected] | ||
with: | ||
root_dir: ${{ github.workspace }}/extension | ||
working-directory: ${{ github.workspace }}/open-forms | ||
files: ./coverage-extension.xml | ||
|
||
docker_build: | ||
name: Build Docker image | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,6 @@ venv.bak/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Editor | ||
.idea/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.