merge queue: embarking main (ffbcc13) and #1611 together #1907
Workflow file for this run
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: Validate PRs | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
on: | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, synchronize, unlocked] | |
jobs: | |
pre-commit: | |
if: github.actor != 'dependabot[bot]' | |
name: Pre-commit (include linter) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: .github/requirements-ci.lock | |
check-latest: true | |
python-version: 3.11 | |
- run: python -m pip config --user set install.use-pep517 true | |
- run: python -m pip install -r .github/requirements-ci.lock | |
- uses: actions/[email protected] | |
with: | |
key: ${{ hashFiles('.pre-commit-config.yaml') }} | |
path: ~/.cache/pre-commit | |
- run: pre-commit run --all-files | |
check-source: | |
if: github.actor != 'dependabot[bot]' | |
name: Check if python source files exist | |
outputs: | |
files_exists: ${{ steps.existence-action.outputs.files_exists }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- id: existence-action | |
uses: andstor/[email protected] | |
with: | |
files: "project_name/**/!(_)*.py, tests/**/test_*.py" | |
test-minimal: | |
env: | |
PYTHONUTF8: 1 | |
if: github.actor != 'dependabot[bot]' && needs.check-source.outputs.files_exists == 'true' | |
name: Run all tests for minimal dependancies | |
needs: check-source | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: .github/requirements-prs/minimal--${{ matrix.os }}--${{ matrix.python-version }}.lock | |
check-latest: true | |
python-version: ${{ matrix.python-version }} | |
- run: python -m pip config --user set install.use-pep517 true | |
- run: python -m pip install -r .github/requirements-prs/minimal--${{ matrix.os }}--${{ matrix.python-version }}.lock | |
- run: python -m pip install -e ".[dev]" | |
- uses: jakebailey/[email protected] | |
- run: python -m coverage run --branch --source=project_name -m hammett | |
- run: mv .coverage .coverage--${{ matrix.os }}--${{ matrix.python-version }} | |
- uses: actions/[email protected] | |
with: | |
name: coverage--minimal--${{ github.sha }} | |
path: .coverage--${{ matrix.os }}--${{ matrix.python-version }} | |
- run: python -m mutmut run --CI --simple-output | |
- run: mv .mutmut-cache .mutmut--${{ matrix.os }}--${{ matrix.python-version }} | |
- uses: actions/[email protected] | |
with: | |
name: mutmut--minimal--${{ github.sha }} | |
path: .mutmut--${{ matrix.os }}--${{ matrix.python-version }} | |
test-minimal-pass: | |
if: ${{ github.actor != 'dependabot[bot]' && always() }} | |
name: All tests for minimal dependancies passed (or skipped) | |
needs: test-minimal | |
runs-on: ubuntu-latest | |
steps: | |
- if: needs.test-minimal.result == 'failure' | |
run: exit 1 | |
test-stable: | |
env: | |
PYTHONUTF8: 1 | |
if: github.actor != 'dependabot[bot]' && needs.check-source.outputs.files_exists == 'true' | |
name: Run all tests for stable dependancies | |
needs: check-source | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
cache: pip | |
cache-dependency-path: .github/requirements-prs/default--${{ matrix.os }}--${{ matrix.python-version }}.lock | |
check-latest: true | |
python-version: ${{ matrix.python-version }} | |
- run: python -m pip config --user set install.use-pep517 true | |
- run: python -m pip install -r .github/requirements-prs/default--${{ matrix.os }}--${{ matrix.python-version }}.lock | |
- run: python -m pip install -e ".[dev, stable]" | |
- uses: jakebailey/[email protected] | |
- run: python -m coverage run --branch --source=project_name -m hammett | |
- run: mv .coverage .coverage--${{ matrix.os }}--${{ matrix.python-version }} | |
- uses: actions/[email protected] | |
with: | |
name: coverage--stable--${{ github.sha }} | |
path: .coverage--${{ matrix.os }}--${{ matrix.python-version }} | |
- run: python -m mutmut run --CI --simple-output | |
- run: mv .mutmut-cache .mutmut--${{ matrix.os }}--${{ matrix.python-version }} | |
- uses: actions/[email protected] | |
with: | |
name: mutmut--stable--${{ github.sha }} | |
path: .mutmut--${{ matrix.os }}--${{ matrix.python-version }} | |
test-stable-pass: | |
if: ${{ github.actor != 'dependabot[bot]' && always() }} | |
name: All tests for stable dependancies passed (or skipped) | |
needs: test-stable | |
runs-on: ubuntu-latest | |
steps: | |
- if: needs.test-stable.result == 'failure' | |
run: exit 1 |