Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer-lock.json
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"
}
}
}
48 changes: 48 additions & 0 deletions .devcontainer/devcontainer.json
Comment thread
neilime marked this conversation as resolved.
Resolved
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"
}
}
132 changes: 132 additions & 0 deletions .github/actions/parse-ci-reports/README.md
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 -->

[![Marketplace](https://img.shields.io/badge/Marketplace-parse--ci--reports-blue?logo=github-actions)](https://github.com/marketplace/actions/parse-ci-reports)
[![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-python)](https://github.com/hoverkraft-tech/ci-github-python/releases)
[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-python)](http://choosealicense.com/licenses/mit/)
[![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](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 -->
52 changes: 52 additions & 0 deletions .github/actions/parse-ci-reports/action.test.cjs
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/);
});
62 changes: 62 additions & 0 deletions .github/actions/parse-ci-reports/action.yml
Comment thread
neilime marked this conversation as resolved.
Resolved
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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: github-actions
Expand Down Expand Up @@ -65,3 +66,18 @@ updates:
uv-dependencies:
patterns:
- "*"
- package-ecosystem: devcontainers
directory: /
schedule:
interval: weekly
day: friday
commit-message:
prefix: build
include: scope
cooldown:
default-days: 7
open-pull-requests-limit: 10
groups:
devcontainers-dependencies:
patterns:
- "*"
1 change: 1 addition & 0 deletions .github/linters/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
quiet: true
skip-path:
- (^|/)node_modules/
Expand Down
9 changes: 1 addition & 8 deletions .github/linters/.jscpd.json
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
}
Loading
Loading