Skip to content

fix: support pytest 8 #1101

fix: support pytest 8

fix: support pytest 8 #1101

Workflow file for this run

name: Syrupy CICD
on:
push:
branches:
- main
pull_request:
env:
CI: 1
VENV: .venv
jobs:
analysis:
name: Code Analysis
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/[email protected]
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Install project dependencies
run: . script/bootstrap
- name: Lint
run: |
poetry run invoke lint
tests:
name: Tests
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12-dev']
fail-fast: true
steps:
- uses: actions/[email protected]
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}
- name: Install project dependencies
run: . script/bootstrap
shell: bash
- name: Run Tests
if: |
!(matrix.python-version == '3.12-dev' && matrix.os == 'ubuntu-latest')
shell: bash
run: poetry run invoke test
- name: Run Tests (with coverage)
if: matrix.python-version == '3.12-dev' && matrix.os == 'ubuntu-latest'
shell: bash
run: poetry run invoke test --coverage
- name: Upload Coverage
if: matrix.python-version == '3.12-dev' && matrix.os == 'ubuntu-latest'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: bash
run: ./.github/codecov.sh $GITHUB_EVENT_PATH
# # TODO: How to do this with poetry?
# version_checks:
# name: Dependency Version Constraint Checks
# runs-on: ubuntu-latest
# if: "!contains(github.event.head_commit.message, '[skip ci]')"
# env:
# SKIP_DEPS: 1
# steps:
# - uses: actions/[email protected]
# - name: Setup Environment
# uses: ./.github/actions/setup-env
# with:
# python-version: 3.7 # it's min, so we'll use an older version of python
# - name: Install project dependencies
# run: |
# . script/bootstrap
# poetry install --with=test
# - name: Test
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# run: |
# . $VENV/bin/activate
# poetry run invoke test --coverage
benchmark:
name: Benchmark
runs-on: ubuntu-latest
if: "github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]')"
needs: [tests]
steps:
- uses: actions/[email protected]
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Install project dependencies
run: . script/bootstrap
- name: Benchmark
run: poetry run invoke benchmark
- name: Publish Benchmark Results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'pytest'
output-file-path: benchmarks.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: false
comment-always: true
dry_run:
name: Release Test Package
runs-on: ubuntu-latest
# Dry run check does not need to wait for others
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'next' && !contains(github.event.head_commit.message, '[skip ci]')
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Install project dependencies
run: . script/bootstrap
- name: Dry Release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PUBLISH_TOKEN }}
run: |
poetry run invoke release --dry-run
release:
name: Release
runs-on: ubuntu-latest
needs: [analysis, tests] # [version_checks]
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Install project dependencies
run: . script/bootstrap
- name: Release
uses: cycjimmy/[email protected]
with:
branch: main
dry_run: false
extra_plugins: |
@semantic-release/changelog
@semantic-release/exec
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.TOPHAT_BOT_GH_TOKEN }}