mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-03-07 04:28:23 +00:00
Attempt at parallelising tests where possible
This commit is contained in:
38
.github/workflows/django.yml
vendored
38
.github/workflows/django.yml
vendored
@@ -15,16 +15,22 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 1
|
|
||||||
matrix:
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: 3.8
|
||||||
- name: Setup Chromedriver
|
- name: Setup Chromedriver
|
||||||
|
if: !${{ matrix.parallel }}
|
||||||
run: |
|
run: |
|
||||||
wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip
|
wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip
|
||||||
unzip chromedriver_linux64.zip
|
unzip chromedriver_linux64.zip
|
||||||
@@ -43,6 +49,26 @@ jobs:
|
|||||||
python manage.py check
|
python manage.py check
|
||||||
python manage.py makemigrations --check --dry-run
|
python manage.py makemigrations --check --dry-run
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
|
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: |
|
run: |
|
||||||
coverage run manage.py test --verbosity=2
|
pip3 install --upgrade coveralls
|
||||||
coveralls --service=github
|
coveralls --service=github --finish
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user