Skip to content

fix: timprove github actions conditioned on template flag #119

fix: timprove github actions conditioned on template flag

fix: timprove github actions conditioned on template flag #119

Workflow file for this run

name: Tests
on:
push:
branches:
- main # Runs on pushes to main branch
pull_request:
branches:
- main # Runs on PRs to main branch
jobs:
check-for-flag-file:
if: github.repository != 'evmckinney9/python-template'
runs-on: ubuntu-latest
outputs:
continue: ${{ steps.flag-check.outputs.continue }}
steps:
- uses: actions/checkout@v4
- name: Check for template_flag.yml
id: flag-check
run: |
if [ ! -f .github/template_flag.yml ]; then
echo "continue=true" >> $GITHUB_OUTPUT
else
echo "continue=false" >> $GITHUB_OUTPUT
fi
run-test:
needs: check-for-flag-file
if: needs.check-for-flag-file.outputs.continue == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: "**/pyproject.toml"
- name: Install dependencies
run: python -m pip install --upgrade pip && pip install -e .[test] --quiet
- name: Run pytest
run: pytest src/tests/