Create GitHub workflow to automatically run tests #64 #2
Workflow file for this run
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: tests | |
on: | |
# trigger when pushed to any branch (for development) | |
push: | |
# trigger when a pull request is made to master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
playwright-tests: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Start Dolos | |
working-directory: dolos | |
run: | | |
docker pull ghcr.io/dodona-edu/dolos-cli:latest | |
docker compose up --detach | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Ensure browsers are installed | |
run: python -m playwright install --with-deps | |
- name: Set up Radar | |
run: | | |
python manage.py migrate | |
DJANGO_SUPERUSER_PASSWORD=Password \ | |
python manage.py createsuperuser \ | |
--no-input \ | |
--username=Username \ | |
--email=Username@email.com | |
- name: Upload submissions and compare | |
run: | | |
bash run_loadsubmissions.sh e2e_tests/testing_data/radar_test_python testcourse exercise1 1 | |
python manage.py recompare testcourse/exercise1 | |
- name: Run Radar | |
run: python manage.py runserver & | |
- name: Run tests | |
run: pytest --tracing=retain-on-failure | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-traces | |
path: test_results/ |