Provide example CI and code test implementation #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2023 Jonas Huber <@jh-RLI> | |
# SPDX-FileCopyrightText: © Reiner Lemoine Institut | |
# | |
# SPDX-License-Identifier: MIT | |
# tox enviroments that run on both pull requests and merge to main | |
name: ci | |
on: | |
push: | |
branches: [production, develop] | |
pull_request: | |
branches: [production, develop] | |
jobs: | |
test: | |
strategy: | |
# fail-fast: false | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.7, 3.9] | |
# you can separate the tox-envs in different .yml files | |
# see version 0.10.1 | |
# https://github.com/joaomcteixeira/python-project-skeleton/releases/tag/v0.10.1 | |
# below the list of tox envs that you wish to include in the matrix | |
tox-envs: [lint, test] | |
# workaround to ignore 'pr' when merging to main | |
# see: https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 | |
isMerge: | |
- ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
exclude: | |
- isMerge: true | |
tox-envs: pr | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install tox | |
- name: unit tests | |
run: tox -e ${{ matrix.tox-envs }} |