Added Github actions workflow
This commit is contained in:
parent
c96431863f
commit
99d7434eea
61
.github/workflows/test.yml
vendored
Normal file
61
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install --upgrade pytest coverage mypy
|
||||||
|
pip install --upgrade -r requirements.txt
|
||||||
|
- name: Run mypy
|
||||||
|
run: mypy updater
|
||||||
|
- name: Run tests with coverage
|
||||||
|
run: |
|
||||||
|
coverage run --source . --omit conf.py -m pytest --junitxml=report.xml
|
||||||
|
coverage report
|
||||||
|
coverage xml
|
||||||
|
- name: Upload test reports
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: test-reports-${{ matrix.python-version }}
|
||||||
|
path: |
|
||||||
|
report.xml
|
||||||
|
coverage.xml
|
||||||
|
|
||||||
|
build-docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: python:latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install --upgrade sphinx
|
||||||
|
pip install --upgrade -r requirements.txt
|
||||||
|
- name: Build docs
|
||||||
|
run: |
|
||||||
|
make html
|
||||||
|
mv -f _build/html public
|
||||||
|
- name: Upload docs
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: built-docs
|
||||||
|
path: public
|
||||||
|
retention-days: 1
|
@ -1,60 +0,0 @@
|
|||||||
stages:
|
|
||||||
- test
|
|
||||||
- doc
|
|
||||||
|
|
||||||
test:mipy:
|
|
||||||
stage: test
|
|
||||||
tags:
|
|
||||||
- linux
|
|
||||||
image: python:3.7
|
|
||||||
interruptible: true
|
|
||||||
script:
|
|
||||||
- 'pip install --upgrade mypy pytest'
|
|
||||||
- 'pip install --upgrade -r requirements.txt'
|
|
||||||
- 'mypy updater'
|
|
||||||
only:
|
|
||||||
- branches@manuelcortez/updater
|
|
||||||
- release
|
|
||||||
- tags
|
|
||||||
- schedules
|
|
||||||
|
|
||||||
test:pytest:
|
|
||||||
stage: test
|
|
||||||
tags:
|
|
||||||
- linux
|
|
||||||
image: python:3.8
|
|
||||||
interruptible: true
|
|
||||||
script:
|
|
||||||
- 'pip install --upgrade pytest coverage'
|
|
||||||
- 'pip install --upgrade -r requirements.txt'
|
|
||||||
- 'coverage run --source . --omit conf.py -m pytest --junitxml=report.xml'
|
|
||||||
- 'coverage report'
|
|
||||||
- 'coverage xml'
|
|
||||||
only:
|
|
||||||
- branches@manuelcortez/updater
|
|
||||||
- release
|
|
||||||
- tags
|
|
||||||
- schedules
|
|
||||||
artifacts:
|
|
||||||
when: always
|
|
||||||
reports:
|
|
||||||
junit: report.xml
|
|
||||||
cobertura: coverage.xml
|
|
||||||
|
|
||||||
pages:
|
|
||||||
image: python:latest
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
interruptible: true
|
|
||||||
only:
|
|
||||||
- main
|
|
||||||
stage: doc
|
|
||||||
script:
|
|
||||||
- 'pip install --upgrade sphinx'
|
|
||||||
- 'pip install --upgrade -r requirements.txt'
|
|
||||||
- 'make html'
|
|
||||||
- 'mv -f _build/html public'
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 day
|
|
||||||
paths:
|
|
||||||
- public
|
|
Loading…
Reference in New Issue
Block a user