Skip to content

Adding a templated release workflow to run on manual dispatch, for no… #38

Adding a templated release workflow to run on manual dispatch, for no…

Adding a templated release workflow to run on manual dispatch, for no… #38

Workflow file for this run

name: 'Run Tests'
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
template-generation:
name: 'Generate Template'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Install Python'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: 'Install cookiecutter'
run: pip install cookiecutter
- name: 'Install Poetry'
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.3.2
- name: 'Generate template'
run: cookiecutter --no-input . project_name='Test Project'
- name: 'Generate lock file'
run: poetry -C ./test-project lock
- name: 'Cache generated project'
uses: actions/cache@v3
with:
path: ./test-project
key: test-project-${{ github.run_id }}
template-tests:
name: 'Test Template'
needs: template-generation
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11']
steps:
- name: 'Install Python'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 'Install Poetry'
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.3.2
- name: 'Restore generated project'
uses: actions/cache@v3
with:
path: ./test-project
key: test-project-${{ github.run_id }}
- name: 'Run tests'
run: make -C test-project all
- name: 'Run pyupgrade'
run: make -C test-project pyupgrade
nix-build:
name: 'Build with Nix'
needs: template-generation
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-11]
steps:
- name: 'Install Nix/Cachix'
uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
- name: 'Restore generated project'
uses: actions/cache@v3
with:
path: ./test-project
key: test-project-${{ github.run_id }}
- name: 'Build with Nix'
run: nix build ./test-project