Skip to content

Tests

Tests #1217

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: '5 1 * * *' # every day at 01:05
env:
FORCE_COLOR: "1"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
context:
- {project_name: testing-123}
- {project_name: testing-123-with-docs, docs: true}
name: ${{ matrix.context.project_name }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup nox
uses: wntrblm/[email protected]
with:
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12, pypy-3.8, pypy-3.9, pypy-3.10"
- name: Generate template via cruft
run: |
pip install cruft
cruft create -y --extra-context '${{ toJSON(matrix.context) }}' .
- name: Show directory structure and file contents
run: |
cd ${{ matrix.context.project_name }}
echo "::group::tree" && tree -a && echo "::endgroup::"
echo "::group::.cruft.json" && cat .cruft.json && echo "::endgroup::"
echo "::group::pyproject.toml" && cat pyproject.toml && echo "::endgroup::"
echo "::group::CONTRIBUTING.rst" && cat CONTRIBUTING.rst && echo "::endgroup::"
echo "::group::noxfile.py" && cat noxfile.py && echo "::endgroup::"
echo "::group::tests.yml" && cat .github/workflows/tests.yml && echo "::endgroup::"
- name: Initialize repository
run: |
cd ${{ matrix.context.project_name }}
git init
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "init"
- name: Run nox
run: |
cd ${{ matrix.context.project_name }}
nox
nox -s lint build dev ${{ matrix.context.docs && 'docs'}}