-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a few extra checks: - Typos - All `pre-commit` checks Also refactor the test CI workflow Signed-off-by: JP-Ellis <[email protected]>
- Loading branch information
Showing
19 changed files
with
207 additions
and
73 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
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 |
---|---|---|
|
@@ -19,9 +19,33 @@ env: | |
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
test-container: | ||
complete: | ||
name: Test completion check | ||
if: always() | ||
|
||
permissions: | ||
contents: none | ||
|
||
runs-on: ubuntu-latest | ||
needs: | ||
- test-linux | ||
- test-other | ||
- example | ||
- format | ||
- lint | ||
- typecheck | ||
- spelling | ||
- pre-commit | ||
|
||
steps: | ||
- name: Failed | ||
run: exit 1 | ||
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') | ||
|
||
test-linux: | ||
name: >- | ||
Tests py${{ matrix.python-version }} on ${{ matrix.os }} | ||
Test Python ${{ matrix.python-version }} | ||
on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
@@ -93,9 +117,10 @@ jobs: | |
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
test-no-container: | ||
test-other: | ||
name: >- | ||
Tests py${{ matrix.python-version }} on ${{ matrix.os }} | ||
Test Python ${{ matrix.python-version }} | ||
on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
|
@@ -139,17 +164,6 @@ jobs: | |
- name: Run tests | ||
run: hatch run test | ||
|
||
test-conlusion: | ||
name: Test matrix complete | ||
|
||
runs-on: ubuntu-latest | ||
needs: | ||
- test-container | ||
- test-no-container | ||
|
||
steps: | ||
- run: echo "Test matrix completed successfully." | ||
|
||
example: | ||
name: Example | ||
|
||
|
@@ -197,6 +211,26 @@ jobs: | |
run: > | ||
hatch run example --broker-url=http://pactbroker:pactbroker@localhost:9292 | ||
format: | ||
name: Format | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5 | ||
with: | ||
python-version: ${{ env.STABLE_PYTHON_VERSION }} | ||
cache: pip | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Format | ||
run: hatch run format | ||
|
||
lint: | ||
name: Lint | ||
|
||
|
@@ -214,11 +248,47 @@ jobs: | |
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Lint | ||
- name: Format | ||
run: hatch run lint | ||
|
||
- name: Typecheck | ||
run: hatch run typecheck | ||
typecheck: | ||
name: Typecheck | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5 | ||
with: | ||
python-version: ${{ env.STABLE_PYTHON_VERSION }} | ||
cache: pip | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Format | ||
run: hatch run format | ||
run: hatch run typecheck | ||
|
||
spelling: | ||
name: Spell check | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Spell Check Repo | ||
uses: crate-ci/typos@master | ||
|
||
pre-commit: | ||
name: Pre-commit | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
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 |
---|---|---|
|
@@ -35,11 +35,11 @@ repos: | |
# allows for comments within JSON files. | ||
- id: check-json5 | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
- repo: https://github.com/biomejs/pre-commit | ||
rev: "v0.4.0" # Use the sha / tag you want to point at | ||
hooks: | ||
- id: prettier | ||
stages: [pre-push] | ||
- id: biome-check | ||
additional_dependencies: ["@biomejs/[email protected]"] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.1 | ||
|
@@ -52,11 +52,25 @@ repos: | |
- id: ruff-format | ||
exclude: ^(pact|tests)/(?!v3/).*\.py$ | ||
|
||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v3.29.0 | ||
- repo: https://github.com/crate-ci/committed | ||
rev: v1.0.20 | ||
hooks: | ||
- id: committed | ||
|
||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.41.0 | ||
hooks: | ||
- id: commitizen | ||
stages: [commit-msg] | ||
- id: markdownlint | ||
exclude: | | ||
(?x)^( | ||
.github/PULL_REQUEST_TEMPLATE\.md | ||
| CHANGELOG.md | ||
) | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.23.6 | ||
hooks: | ||
- id: typos | ||
|
||
- repo: local | ||
hooks: | ||
|
@@ -69,13 +83,3 @@ repos: | |
types: [python] | ||
exclude: ^(src/pact|tests)/(?!v3/).*\.py$ | ||
stages: [pre-push] | ||
|
||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.41.0 | ||
hooks: | ||
- id: markdownlint | ||
exclude: | | ||
(?x)^( | ||
.github/PULL_REQUEST_TEMPLATE\.md | ||
| CHANGELOG.md | ||
) |
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.