Tests #558
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: 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@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup nox | |
uses: wntrblm/[email protected] | |
with: | |
python-versions: "3.8, 3.9, 3.10, 3.11, pypy-3.8, pypy-3.9" | |
- 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::setup.cfg" && cat setup.cfg && 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 safety build dev ${{ matrix.context.docs && 'docs'}} |