github workflow fixes #3
Workflow file for this run
This file contains hidden or 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: tests | |
| on: [push] | |
| jobs: | |
| tests: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: "Setup: Copy environment variables" | |
| run: cp .env_circleci .env | |
| - name: "Setup: Create directories for MinIO (cannot be made by docker for some reason)" | |
| run: | | |
| mkdir -p var/minio/public | |
| mkdir -p var/minio/private | |
| - name: "Setup: Prepare the playwright environment" | |
| run: | | |
| cd tests | |
| npm install | |
| - name: "Docker: Build containers and collect static files" | |
| run: | | |
| docker compose -f docker-compose.yml -f docker-compose.selenium.yml -f docker-compose.playwright.yml up -d | |
| docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput | |
| docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py migrate | |
| docker compose -f docker-compose.yml exec django python ./manage.py createsuperuser --no-input | |
| - name: "Lint: Check code style with flake8" | |
| run: docker compose exec django flake8 src/ | |
| - name: "Tests: Run unit/integration tests (excluding e2e)" | |
| run: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e" | |
| - name: "Tests: Run end-to-end (E2E) tests" | |
| run: cd tests && PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/ npx playwright test | |
| - name: Cleanup | |
| run: | | |
| docker compose -f docker-compose.yml -f docker-compose.selenium.yml -f docker-compose.playwright.yml down --rmi all | |
| rm -rf ${{ github.workspace }}\* |