mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Attempt at parallelising tests where possible
This commit is contained in:
40
.github/workflows/django.yml
vendored
40
.github/workflows/django.yml
vendored
@@ -15,16 +15,22 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
test-group: ["RIGS.tests.test_unit", "RIGS.tests.test_models", "RIGS.tests.test_functional", "versioning.tests.test_versioning", "users.tests.test_users"]
|
||||
parallel: true
|
||||
include:
|
||||
- test-group: "assets.tests.test_assets"
|
||||
parallel: false
|
||||
- test-group: "RIGS.tests.test_interaction"
|
||||
parallel: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
python-version: 3.8
|
||||
- name: Setup Chromedriver
|
||||
if: !${{ matrix.parallel }}
|
||||
run: |
|
||||
wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip
|
||||
unzip chromedriver_linux64.zip
|
||||
@@ -43,6 +49,26 @@ jobs:
|
||||
python manage.py check
|
||||
python manage.py makemigrations --check --dry-run
|
||||
- name: Run Tests
|
||||
run: |
|
||||
coverage run manage.py test --verbosity=2
|
||||
coveralls --service=github
|
||||
if: !${{ matrix.parallel }}
|
||||
run: coverage run manage.py test ${{ matrix.test-group }} --verbosity=2
|
||||
- name: Run Tests (Parallel)
|
||||
if: ${{ matrix.parallel }}
|
||||
run: coverage run manage.py test ${{ matrix.test-group }} --parallel --verbosity=2
|
||||
- name: Upload Coverage
|
||||
run: coveralls
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
COVERALLS_FLAG_NAME: ${{ matrix.test-group }}
|
||||
COVERALLS_PARALLEL: true
|
||||
coveralls:
|
||||
name: Indicate completion to coveralls.io
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
container: python:3-slim
|
||||
steps:
|
||||
- name: Finished
|
||||
run: |
|
||||
pip3 install --upgrade coveralls
|
||||
coveralls --service=github --finish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user