Test Revisions #36
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: Django CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.10.15] | |
| steps: | |
| - name: Fetch Main Janeway Branch | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: PLOS/janeway | |
| ref: develop | |
| path: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway | |
| - name: Fetch Editorial Manager Transfer Service | |
| uses: actions/checkout@v5 | |
| with: | |
| path: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/plugins/editorial_manager_transfer_service | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip # Path to pip's cache directory | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} # Unique cache key | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| find . -name "*requirements.txt" -type f -exec pip install -r '{}' ';' | |
| - name: Add `src` to Python Path | |
| run: | | |
| echo "PYTHONPATH=/home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Import the Default Janeway Settings | |
| run: | | |
| cp /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/core/dev_settings.py /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway/src/core/settings.py | |
| - name: Run Tests | |
| env: | |
| JANEWAY_SETTINGS_MODULE: core.settings | |
| DJANGO_SETTINGS_MODULE: core.settings | |
| working-directory: /home/runner/work/editorial_manager_transfer_service/editorial_manager_transfer_service/janeway | |
| run: | | |
| python src/manage.py test editorial_manager_transfer_service |