Run tests, linters, formatters #166
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
name: Run tests, linters, formatters | |
on: | |
push: | |
branches: [master, develop, release/**] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
inputs: | |
triggeredBy: | |
description: 'Name of team member who is manually triggering this workflow' | |
required: true | |
default: '' | |
defaults: | |
run: | |
shell: bash | |
env: | |
LANG: en_US.utf-8 | |
LC_ALL: en_US.utf-8 | |
jobs: | |
run-tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python: ['3.10', '3.11', '3.12'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- if: ${{ inputs.triggeredBy != '' }} | |
run: | | |
echo "This workflow was triggered by: $TEAM_MEMBER" | |
env: | |
TEAM_MEMBER: ${{ inputs.triggeredBy }} | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
#---------------------------------------------- | |
# install other testing dependencies | |
#---------------------------------------------- | |
- name: Install tox, pytest-github, tox-gh-actions | |
run: pip install 'tox>=4.4.11' 'pytest-github-actions-annotate-failures>=0.1.7' 'tox-gh-actions' | |
#---------------------------------------------- | |
# Run tests, linters defined in Tox | |
#---------------------------------------------- | |
- name: Run tests, linters | |
run: | | |
tox |