Skip to content

Update dependencies and tooling #407

Update dependencies and tooling

Update dependencies and tooling #407

Workflow file for this run

name: Tests
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
- name: Restore pre-commit cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ runner.os }}|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
uses: pre-commit/[email protected]
test:
name: ${{ matrix.os }} / ${{ matrix.python }}
needs: linting
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [Ubuntu, macOS, Windows]
python: [3.9, 3.10, 3.11, 3.12]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: poetry
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest tests --cov jekyllnb --cov-report xml:coverage.xml
- name: Upload coverage report
uses: codecov/codecov-action@v4
if: success()
with:
file: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Send Slack message on failure
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: '${{ runner.os }} :snake: ${{ matrix.python }} Tests'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
slack:
name: Slack
runs-on: ubuntu-latest
needs: test
steps:
- name: Send Slack message
uses: lazy-actions/[email protected]
if: always()
with:
type: ${{ job.status }}
job_name: ':snake: Tests'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}