Repository navigation
fix: complete linting, branding and development tooling #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b76a270
fix: enforce lint checks without source suppressions
neilime c7cf16c
docs: regenerate references for lint fixes
neilime 479a5d1
docs: preserve repository metadata during generation
neilime ec34d60
fix: resolve CI fixture and artifact validation failures
neilime cd59232
fix: align report naming, lint scopes and project artwork
neilime ccd31c9
docs: regenerate references for reviewed actions
neilime a53a741
test: verify lint reports after the producer job completes
neilime f9227d0
chore: add a Python development container
neilime f666b9a
refactor: simplify devcontainers and colocate action tests
neilime dab6f05
test: run action contracts in dedicated workflows
neilime d51bf47
ci: reuse shared Node.js test action
neilime File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "features": { | ||
| "ghcr.io/devcontainers-extra/features/uv:1": { | ||
| "version": "1.0.2", | ||
| "resolved": "ghcr.io/devcontainers-extra/features/uv@sha256:1ac5b9f17a9e9e745933d0ac2ecf758e06ed3da4423cd22c94cce4d482fd2dd8", | ||
| "integrity": "sha256:1ac5b9f17a9e9e745933d0ac2ecf758e06ed3da4423cd22c94cce4d482fd2dd8" | ||
| }, | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "version": "2.7.2", | ||
| "resolved": "ghcr.io/devcontainers/features/common-utils@sha256:08e5a6ad4b672301c2010944217aeea4f428a87f4349d9bbf8bc97211238674b", | ||
| "integrity": "sha256:08e5a6ad4b672301c2010944217aeea4f428a87f4349d9bbf8bc97211238674b" | ||
| }, | ||
| "ghcr.io/devcontainers/features/docker-in-docker:4": { | ||
| "version": "4.1.3", | ||
| "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:fae40f3c8be5a7c3b0db344c1d30341bc2c91ba38d1d5b14cd2ad72e6d65d084", | ||
| "integrity": "sha256:fae40f3c8be5a7c3b0db344c1d30341bc2c91ba38d1d5b14cd2ad72e6d65d084" | ||
| }, | ||
| "ghcr.io/devcontainers/features/github-cli:1": { | ||
| "version": "1.1.3", | ||
| "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2", | ||
| "integrity": "sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2" | ||
| }, | ||
| "ghcr.io/devcontainers/features/node:2": { | ||
| "version": "2.1.2", | ||
| "resolved": "ghcr.io/devcontainers/features/node@sha256:20ac718cc67e7999a9d3fbb8387f1a3a5d53ecbd41fe7c075ebadb8e9b431b17", | ||
| "integrity": "sha256:20ac718cc67e7999a9d3fbb8387f1a3a5d53ecbd41fe7c075ebadb8e9b431b17" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| "name": "hoverkraft-tech/ci-github-python", | ||
| "image": "mcr.microsoft.com/devcontainers/base:debian", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "configureZshAsDefaultShell": true | ||
| }, | ||
| "ghcr.io/devcontainers/features/node:2": { | ||
| "pnpmVersion": "none" | ||
| }, | ||
| "ghcr.io/devcontainers/features/docker-in-docker:4": { | ||
| "moby": false | ||
| }, | ||
| "ghcr.io/devcontainers/features/github-cli:1": { | ||
| "extensions": "nektos/gh-act" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/uv:1": {} | ||
| }, | ||
| "remoteUser": "vscode", | ||
| "init": true, | ||
| "postCreateCommand": "make setup", | ||
| "waitFor": "postCreateCommand", | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "eamodio.gitlens", | ||
| "github.vscode-github-actions", | ||
| "github.copilot", | ||
| "github.copilot-chat", | ||
| "ms-vscode.makefile-tools", | ||
| "biomejs.biome", | ||
| "ms-python.python", | ||
| "ms-python.vscode-pylance", | ||
| "ms-python.black-formatter", | ||
| "charliermarsh.ruff" | ||
| ], | ||
| "settings": { | ||
| "python.defaultInterpreterPath": "${containerWorkspaceFolder}/tests/python-project/.venv/bin/python", | ||
| "[python]": { | ||
| "editor.defaultFormatter": "ms-python.black-formatter" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "containerEnv": { | ||
| "UV_LINK_MODE": "copy" | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| <!-- header:start --> | ||
|
|
||
| # GitHub Action: Parse CI reports | ||
|
|
||
| <div align="center"> | ||
| <img src="../../logo.svg" width="60px" align="center" alt="Parse CI reports" /> | ||
| </div> | ||
|
|
||
| --- | ||
|
|
||
| <!-- header:end --> | ||
|
|
||
| <!-- jscpd:ignore-start --> | ||
| <!-- Generated repository badges repeat across references. --> | ||
|
|
||
| <!-- badges:start --> | ||
|
|
||
| [](https://github.com/marketplace/actions/parse-ci-reports) | ||
| [](https://github.com/hoverkraft-tech/ci-github-python/releases) | ||
| [](http://choosealicense.com/licenses/mit/) | ||
| [](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social) | ||
| [](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) | ||
|
|
||
| <!-- badges:end --> | ||
|
|
||
| <!-- jscpd:ignore-end --> | ||
|
|
||
| <!-- overview:start --> | ||
|
|
||
| ## Overview | ||
|
|
||
| Parse native reports, publish summaries and retain selected files in one artifact. Internal helper for lint and test. | ||
|
|
||
| <!-- overview:end --> | ||
|
|
||
| <!-- jscpd:ignore-start --> | ||
| <!-- Generated API reference repeats action and workflow metadata. --> | ||
|
|
||
| <!-- usage:start --> | ||
|
|
||
| ## Usage | ||
|
|
||
| ```yaml | ||
| - uses: hoverkraft-tech/ci-github-python/.github/actions/parse-ci-reports@f9227d0f443be4edbb7aacfc0701caaf25523f77 # fix/enforce-lint-checks | ||
| with: | ||
| # Validated absolute project directory. | ||
| # This input is required. | ||
| directory: "" | ||
|
|
||
| # Report paths or auto selectors passed to the common parser. | ||
| # Default: `auto:test` | ||
| report-paths: auto:test | ||
|
|
||
| # Calling job ID used to group reports. | ||
| # This input is required. | ||
| group: "" | ||
|
|
||
| # Title of the GitHub report summary. | ||
| # Default: `CI reports` | ||
| report-name: CI reports | ||
| ``` | ||
|
|
||
| <!-- usage:end --> | ||
|
|
||
| <!-- inputs:start --> | ||
|
|
||
| ## Inputs | ||
|
|
||
| | **Input** | **Description** | **Required** | **Default** | | ||
| | ------------------ | ----------------------------------------------------------- | ------------ | ------------ | | ||
| | **`directory`** | Validated absolute project directory. | **true** | - | | ||
| | **`report-paths`** | Report paths or auto selectors passed to the common parser. | **false** | `auto:test` | | ||
| | **`group`** | Calling job ID used to group reports. | **true** | - | | ||
| | **`report-name`** | Title of the GitHub report summary. | **false** | `CI reports` | | ||
|
|
||
| <!-- inputs:end --> | ||
|
|
||
| <!-- secrets:start --> | ||
| <!-- secrets:end --> | ||
|
|
||
| <!-- outputs:start --> | ||
|
|
||
| ## Outputs | ||
|
|
||
| | **Output** | **Description** | | ||
| | ----------------- | ---------------------------------------------------------- | | ||
| | **`artifact-id`** | Uploaded artifact ID, or empty when no report files exist. | | ||
|
|
||
| <!-- outputs:end --> | ||
|
|
||
| <!-- jscpd:ignore-end --> | ||
|
|
||
| <!-- examples:start --> | ||
| <!-- examples:end --> | ||
|
|
||
| <!-- jscpd:ignore-start --> | ||
| <!-- Generated repository and tool boilerplate repeats across references. --> | ||
|
|
||
| <!-- contributing:start --> | ||
|
|
||
| ## Contributing | ||
|
|
||
| Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) for more details. | ||
|
|
||
| <!-- contributing:end --> | ||
|
|
||
| <!-- security:start --> | ||
| <!-- security:end --> | ||
|
|
||
| <!-- license:start --> | ||
|
|
||
| ## License | ||
|
|
||
| This project is licensed under the MIT License. | ||
|
|
||
| SPDX-License-Identifier: MIT | ||
|
|
||
| Copyright © 2026 hoverkraft-tech | ||
|
|
||
| For more details, see the [license](http://choosealicense.com/licenses/mit/). | ||
|
|
||
| <!-- license:end --> | ||
|
|
||
| <!-- generated:start --> | ||
|
|
||
| --- | ||
|
|
||
| This documentation was automatically generated by [CI Dokumentor](https://github.com/hoverkraft-tech/ci-dokumentor). | ||
|
|
||
| <!-- generated:end --> | ||
|
|
||
| <!-- jscpd:ignore-end --> |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| const assert = require("node:assert/strict"); | ||
| const fs = require("node:fs"); | ||
| const path = require("node:path"); | ||
| const test = require("node:test"); | ||
| const { | ||
| createWorkspace, | ||
| loadActionStep, | ||
| } = require("../../../tests/action-test-helpers.cjs"); | ||
|
|
||
| const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor; | ||
|
|
||
| test("report artifacts contain only parsed reports and use unique names", async (t) => { | ||
| const directory = createWorkspace(t); | ||
| const report = path.join(directory, "junit.xml"); | ||
| fs.writeFileSync(report, "<testsuites/>"); | ||
| fs.writeFileSync( | ||
| path.join(directory, "unrelated-secret.txt"), | ||
| "not a report", | ||
| ); | ||
| const prepare = new AsyncFunction( | ||
| "core", | ||
| "process", | ||
| "require", | ||
| loadActionStep(path.join(__dirname, "action.yml"), "prepare").with.script, | ||
| ); | ||
| async function outputs(files, group = "outer-job") { | ||
| const result = {}; | ||
| await prepare( | ||
| { | ||
| setOutput: (key, value) => { | ||
| result[key] = value; | ||
| }, | ||
| }, | ||
| { | ||
| env: { | ||
| DIRECTORY: directory, | ||
| REPORT_FILES: JSON.stringify(files), | ||
| REPORT_GROUP: group, | ||
| GITHUB_RUN_ATTEMPT: "2", | ||
| }, | ||
| }, | ||
| require, | ||
| ); | ||
| return result; | ||
| } | ||
| assert.deepEqual(await outputs([]), {}); | ||
| const first = await outputs([report]); | ||
| assert.equal(first.files, report); | ||
| assert.match(first.name, /^ci-reports-2-outer-job-/); | ||
| assert.notEqual(first.name, (await outputs([report])).name); | ||
| await assert.rejects(() => outputs([report], "../bad-group"), /report-group/); | ||
| }); |
|
neilime marked this conversation as resolved.
Resolved
|
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| name: Parse CI reports | ||
| description: | ||
| Parse native reports, publish summaries and retain selected files in one artifact. Internal helper for lint and | ||
| test. | ||
| inputs: | ||
| directory: | ||
| description: Validated absolute project directory. | ||
| required: true | ||
| report-paths: | ||
| description: Report paths or auto selectors passed to the common parser. | ||
| default: auto:test | ||
| group: | ||
| description: Calling job ID used to group reports. | ||
| required: true | ||
| report-name: | ||
| description: Title of the GitHub report summary. | ||
| default: CI reports | ||
| outputs: | ||
| artifact-id: | ||
| description: Uploaded artifact ID, or empty when no report files exist. | ||
| value: ${{ steps.upload.outputs.artifact-id }} | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - id: parse | ||
| if: ${{ !cancelled() }} | ||
| uses: hoverkraft-tech/ci-github-common/actions/quality/parse-ci-reports@66882b24f9f13e45a6541896a5a7c638cb91c94c | ||
| with: | ||
| working-directory: ${{ inputs.directory }} | ||
| report-paths: | | ||
| ${{ inputs.report-paths }} | ||
| !**/.venv/** | ||
| !**/.git/** | ||
| !**/.cache/** | ||
| !**/vendor/** | ||
| report-name: ${{ inputs.report-name }} | ||
| output-format: annotations,summary,markdown | ||
| - id: prepare | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 | ||
| env: | ||
| DIRECTORY: ${{ inputs.directory }} | ||
| REPORT_FILES: ${{ steps.parse.outputs.parsed-files }} | ||
| REPORT_GROUP: ${{ inputs.group }} | ||
| with: | ||
| script: | | ||
| const files = JSON.parse(process.env.REPORT_FILES || '[]'); | ||
| if (!files.length) return; | ||
| const group = process.env.REPORT_GROUP; | ||
| if (!/^[\w-]+$/.test(group)) throw new Error('report-group must be a job ID.'); | ||
| core.setOutput('files', files.join('\n')); | ||
| core.setOutput('name', `ci-reports-${process.env.GITHUB_RUN_ATTEMPT}-${group}-${require('node:crypto').randomUUID()}`); | ||
| if: ${{ !cancelled() }} | ||
| - id: upload | ||
| if: ${{ !cancelled() && steps.prepare.outputs.files != '' }} | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 | ||
| with: | ||
| name: ${{ steps.prepare.outputs.name }} | ||
| path: ${{ steps.prepare.outputs.files }} | ||
| include-hidden-files: true | ||
| if-no-files-found: error | ||
| retention-days: 7 |
This file contains hidden or 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 hidden or 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,3 +1,4 @@ | ||
| --- | ||
| quiet: true | ||
| skip-path: | ||
| - (^|/)node_modules/ | ||
|
|
||
This file contains hidden or 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,10 +1,3 @@ | ||
| { | ||
| "threshold": 5, | ||
| "ignore": [ | ||
| "**/vendor/**", | ||
| "**/actions/**/README.md", | ||
| "**/.github/workflows/*.md", | ||
| "**/.github/logo.svg", | ||
| "**/.github/social-preview.svg" | ||
| ] | ||
| "threshold": 5 | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.