generated from tophat/new-project-kit
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
734 additions
and
685 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[flake8] | ||
max-line-length=88 | ||
ignore=A005,W503 |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
name: Syrupy CICD | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CI: 1 | ||
VENV: .venv | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
jobs: | ||
analysis: | ||
name: Code Analysis | ||
|
@@ -24,6 +32,7 @@ jobs: | |
- name: Lint | ||
run: | | ||
poetry run invoke lint | ||
tests: | ||
name: Tests | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -42,21 +51,20 @@ jobs: | |
- 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) | ||
id: 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: "" # FIXME: Needs a new token. | ||
- name: Run Tests | ||
if: steps.tests-with-coverage.outcome == 'skipped' | ||
shell: bash | ||
run: ./.github/codecov.sh $GITHUB_EVENT_PATH | ||
run: poetry run invoke test | ||
- name: Upload Coverage | ||
if: steps.tests-with-coverage.conclusion == 'success' | ||
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# # TODO: How to do this with poetry? | ||
# version_checks: | ||
|
@@ -87,6 +95,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: "github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]')" | ||
needs: [tests] | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Setup Environment | ||
|
@@ -100,58 +111,22 @@ jobs: | |
with: | ||
tool: 'pytest' | ||
output-file-path: benchmarks.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
github-token: ${{ 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 | ||
required_checks: | ||
name: Required Checks | ||
needs: | ||
- analysis | ||
- tests | ||
- benchmark | ||
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]') | ||
if: always() | ||
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: "" # FIXME: Needs a new 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: "" # FIXME: Needs a new 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: "" #FIXME: Needs a new token. | ||
- name: Fail on error | ||
if: contains(needs.*.result, 'failure') || cancelled() | ||
run: exit 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Syrupy Manual Release | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -11,18 +11,19 @@ jobs: | |
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: "" # FIXME: Needs a new token. | ||
environment: release | ||
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: | ||
|
@@ -33,4 +34,6 @@ jobs: | |
@semantic-release/exec | ||
@semantic-release/git | ||
env: | ||
GITHUB_TOKEN: "" # FIXME: Needs a new token. | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_PAT }} |
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
Oops, something went wrong.