Skip to content

Commit

Permalink
ci: Add CI pipeline via GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Pepe committed Dec 14, 2023
1 parent ba289cc commit 15ee8bf
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 5 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI pipeline

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: python -m pip install --upgrade pip tox tox-gh-actions

- name: Run tests
run: tox

- name: Upload coverage artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python-version }}
path: reports/.coverage.*test

coverage:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Download all coverage artifacts
uses: actions/download-artifact@v3

- name: Install tox
run: python -m pip install --upgrade pip tox

- name: Combine coverage results
run: tox run -e combine-test-reports

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install tox
run: python -m pip install --upgrade tox

- name: Run static checks
run: tox -e lint
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ url = https://github.com/vorausrobotik/voraus-template-updater


[options]
python_requires = >=3.9
python_requires = >=3.8
packages = find:
package_dir =
=src
Expand Down
16 changes: 12 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
[tox]
envlist =
lint
{py39,py311}-test
{py38,py39,py310,py311,py312}-test
combine-test-reports
isolated_build = True

[gh-actions]
python =
3.8: py38-test
3.9: py39-test
3.10: py310-test
3.11: py311-test
3.12: py312-test

[testenv:lint]
description = Run static checkers.
basepython = py39
basepython = py38
extras = lint
passenv = CODEMETER_HOST
commands =
Expand All @@ -26,7 +33,7 @@ commands =
pylint --load-plugins pylint.extensions.docparams src {posargs}


[testenv:{py39,py311}-test]
[testenv:{py38,py39,py310,py311,py312}-test]
description = Run doc tests and unit tests.
package = wheel
extras = test
Expand All @@ -45,7 +52,7 @@ description = Combine test and coverage data from multiple test runs.
skip_install = true
setenv =
COVERAGE_FILE = reports/.coverage
depends = {py39,py311}-test
depends = {py38,py39,py310,py311,py312}-test
deps =
junitparser
coverage[toml]
Expand All @@ -54,6 +61,7 @@ commands =
coverage combine --keep
coverage html
coverage xml
coverage report


[testenv:docs]
Expand Down

0 comments on commit 15ee8bf

Please sign in to comment.