Merge pull request #96 from Harman-Aalto/issue-76 #48
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: | |
# 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 | |
# Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
# Set up Dolos | |
- name: Start Dolos | |
working-directory: dolos | |
run: | | |
docker pull ghcr.io/dodona-edu/dolos-cli:latest | |
docker compose up --detach | |
# Set up Radar dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Set up Greedy String Tiling | |
- name: Install GST | |
working-directory: matcher/greedy_string_tiling | |
run: pip install . | |
# Install browsers for Playwright | |
- name: Ensure browsers are installed | |
run: python -m playwright install --with-deps | |
# Set up Radar user | |
- name: Set up Radar | |
run: | | |
python manage.py migrate | |
DJANGO_SUPERUSER_PASSWORD=Password \ | |
python manage.py createsuperuser \ | |
--no-input \ | |
--username=Username \ | |
[email protected] | |
# Setup test data | |
- 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 | |
# Run Radar | |
- name: Run Radar | |
run: python manage.py runserver & | |
# Run tests | |
- name: Run tests | |
run: pytest --tracing=retain-on-failure | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-traces | |
path: test_results/ |