Skip to content

Commit

Permalink
[ci] Separate job for QA tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Nov 1, 2023
1 parent 5840e4f commit ca29ea3
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 17 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ on:
- master

jobs:
build:
qa-tests:
name: QA tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: QA checks
run: |
pip install -r requirements-test-qa.txt
pip install "importlib-metadata<5.0" # remove when flake8 is upgraded
./run-qa-checks
unit-tests:
name: Python==${{ matrix.env.python }} | ${{ matrix.env.TOXENV }}
runs-on: ubuntu-20.04

Expand Down Expand Up @@ -72,9 +86,7 @@ jobs:
- python: 3.9
TOXENV: py39-django40-djangorestframework313
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.env.python }}
uses: actions/setup-python@v2
Expand All @@ -89,7 +101,7 @@ jobs:
- name: Install python dependencies
run: |
pip install -U pip wheel setuptools
pip install -U -r requirements-test.txt
pip install -U -r requirements-unit-test.txt
pip install tox docutils pygments twine
- name: Tests
Expand All @@ -106,14 +118,9 @@ jobs:
python-${{ matrix.env.env }}
COVERALLS_PARALLEL: true

- name: QA checks
run: |
pip install "importlib-metadata<5.0" # remove when flake8 is upgraded
./run-qa-checks
coveralls:
name: Finish Coveralls
needs: build
needs: unit-tests
runs-on: ubuntu-latest
container: python:3-slim
steps:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ ENV PYTHONUNBUFFERED=1 \

WORKDIR /project

COPY requirements-test.txt /project/
COPY requirements-unit-test.txt /project/

RUN pip install --no-cache-dir -r requirements-test.txt
RUN pip install --no-cache-dir -r requirements-unit-test.txt
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ Install the test requirements:

.. code-block:: shell
pip install -r requirements-test.txt
pip install -r requirements-test-qa.txt
Reformat the code according to
`our coding style conventions with <https://openwisp.io/docs/developer/contributing.html#coding-style-conventions>`_:
Expand Down
2 changes: 2 additions & 0 deletions requirements-test-qa.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# QA checks
openwisp-utils[qa]~=1.0.0
2 changes: 0 additions & 2 deletions requirements-test.txt → requirements-unit-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
psycopg2~=2.8.0
django-filter>=2.0
contexttimer
# QA checks
openwisp-utils[qa]~=1.0.0
packaging~=20.4
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ envlist =
py{37,38,39,py3}-django{22}-djangorestframework{310,312}{,-pytest}
py{37,38,39,py3}-django{30,31,32}-djangorestframework{312}{,-pytest}
py{38,39,py3}-django{40}-djangorestframework{313}{,-pytest}
py{311}-django{42}-djangorestframework{314}{,-pytest}

[testenv]
usedevelop = true
Expand All @@ -22,10 +23,12 @@ deps =
django31: Django~=3.1.0
django32: Django~=3.2.0
django40: Django~=4.0.0
django42: Django~=4.2.6
djangorestframework310: djangorestframework~=3.10.0
djangorestframework312: djangorestframework~=3.12.0
djangorestframework313: djangorestframework~=3.13.0
-rrequirements-test.txt
djangorestframework313: djangorestframework~=3.13.0
-rrequirements-unit-test.txt
pytest: pytest
pytest: pytest-django

Expand Down

0 comments on commit ca29ea3

Please sign in to comment.