fix E2E tests and add instructions to README for running tests locally #8
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: Unit Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Janeway | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: BirkbeckCTP/janeway | |
| ref: master | |
| - name: Checkout geometadata plugin | |
| uses: actions/checkout@v4 | |
| with: | |
| path: src/plugins/geometadata/ | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| cache-dependency-path: | | |
| requirements.txt | |
| dev-requirements.txt | |
| src/plugins/geometadata/requirements.txt | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r dev-requirements.txt | |
| pip install -r src/plugins/geometadata/requirements.txt | |
| - name: Set environment variables | |
| run: | | |
| echo "DB_VENDOR=sqlite" >> "$GITHUB_ENV" | |
| echo "JANEWAY_SETTINGS_MODULE=core.janeway_global_settings" >> "$GITHUB_ENV" | |
| - name: Check code formatting | |
| run: ruff format --check src/plugins/geometadata/ | |
| - name: Lint code | |
| run: ruff check src/plugins/geometadata/ | |
| - name: Run tests | |
| working-directory: src | |
| run: python manage.py test plugins.geometadata.tests.test_models plugins.geometadata.tests.test_views plugins.geometadata.tests.test_hooks plugins.geometadata.tests.test_forms plugins.geometadata.tests.test_geocoding plugins.geometadata.tests.test_geojson_validation --verbosity=2 |