Skip to content

Test

Test #157

Workflow file for this run

name: Test
on:
push:
schedule:
- cron: '0 12 1 * *' # 12:00, first day of the month
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install test runner
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Run linters
run: tox -e lint
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install test runner
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Build docs
run: tox -e docs
- name: Update docs
if: |
github.repository == 'avaldebe/PyPMS' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
run: tox -e docs-deploy -- --force
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install test runner
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Run tests
run: tox -e py
build:
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install PyPA build
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build distribution package
run: python -m build
release:
runs-on: ubuntu-latest
needs: [build, docs, test, lint]
if: |
github.repository == 'avaldebe/PyPMS' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
body_path: README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}