Skip to content

Test

Test #143

Workflow file for this run

name: Test
on:
schedule:
- cron: "0 4 * * *"
pull_request:
workflow_dispatch:
inputs:
logLevel:
description: Log level
required: false
default: WARNING
type: choice
options:
- WARNING
- DEBUG
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
fail-fast: false
env:
PYTHON_VERSION: ${{ matrix.python-version }}
OPERATING_SYSTEM: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Packages
run: |
pip install -r requirements.txt
pip install -r test-requirements.txt
- name: Test at Debug Level
if: ${{ inputs.logLevel == 'DEBUG' }}
run: |
echo "Log level: DEBUG"
pytest -v --log-cli-level=DEBUG
- name: Test at Warning Level
if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }}
run: |
echo "Log level: WARNING"
pytest -v --log-cli-level=WARNING
notify_for_failures:
name: Notify for Failures
needs: [test]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack of Failures
uses: Bandwidth/[email protected]
with:
job-status: failure
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}