CI improvements (#5061)

* Add step to vendor dependencies in the Makefile

* Reorganize the order of jobs and dependencies

* Make all jobs run only after the lint stage
This commit is contained in:
Oz N Tiram
2022-04-20 14:17:01 +02:00
committed by GitHub
parent 853aaf8321
commit 891486e180
3 changed files with 38 additions and 23 deletions
+30 -23
View File
@@ -1,5 +1,4 @@
name: CI
on:
push:
paths-ignore:
@@ -29,10 +28,38 @@ on:
- ".gitmodules"
- ".gitattributes"
- ".editorconfig"
jobs:
lint:
name: Check code linting
runs-on: ubuntu-latest
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PYTHONIOENCODING: "utf-8"
GIT_ASK_YESNO: "false"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: |
python -m pip install pre-commit
pre-commit run --all-files --verbose --show-diff-on-failure
vendor:
name: Vendoring
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: |
python -m pip install --upgrade wheel invoke parver bs4 vistir towncrier
python -m invoke vendoring.update
tests:
name: ${{matrix.os}} / ${{ matrix.python-version }}
needs: lint
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
@@ -52,7 +79,6 @@ jobs:
id: python-path
run: |
echo ::set-output name=path::$(python -c "import sys; print(sys.executable)")
- name: Install latest pip, setuptools, wheel
run: |
python -m pip install --upgrade pip setuptools wheel --upgrade-strategy=eager
@@ -67,14 +93,6 @@ jobs:
git submodule update --init --recursive
python -m pip install -e . --upgrade
pipenv install --deploy --dev --python=${{ steps.python-path.outputs.path }}
- name: Lint check of the code
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PYTHONIOENCODING: "utf-8"
GIT_ASK_YESNO: "false"
run: |
pipenv run pre-commit run --all-files --verbose --show-diff-on-failure
- name: Run tests
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -90,6 +108,7 @@ jobs:
build:
name: Build Package
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -100,15 +119,3 @@ jobs:
- run: |
python -m build
twine check dist/*
vendor:
name: Vendoring
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: |
python -m pip install --upgrade wheel invoke parver bs4 vistir towncrier
python -m invoke vendoring.update