Skip to content
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

feat(pdm): attach builded library to the workflow and the PR if any #214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions pdm/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:

| Input | Description | Default | Required |
|-------|-------------|---------|----------|
| `kind` | Kind of project to release (`lib`/`app`) | `app` | `true` |
| `python-version` | Python version to run the tests with | `3.11` | `true` |
| `pypi-token` | A Token to Ledger private PyPI with read permissions | `""` | `true` |
| `github-token` | A Github token with proper permissions | `${{ github.token }}` | `false` |
Expand Down
35 changes: 35 additions & 0 deletions pdm/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test
description: Execute test using `pdm` scripts

inputs:
kind:
description: Kind of project to release (lib/app)
default: app
python-version:
description: Python version to run the tests with
required: true
Expand Down Expand Up @@ -134,3 +137,35 @@ runs:
curl -X POST -H "Content-Type:text/xml" -d @reports/coverage.xml "${REPORT_URL}&coverageType=cobertura"
echo "📊 Coverage report uploaded to Backstage: <${REPORT_URL}>" >> $GITHUB_STEP_SUMMARY
shell: bash

- name: Build the library
if: inputs.kind == 'lib'
run: pdm build
env:
FORCE_COLOR: 'true'
shell: bash

- name: Attached built library (wheel & sdist) as a workflow artifact
id: upload-lib
if: inputs.kind == 'lib'
uses: actions/upload-artifact@v4
with:
name: library
path: |
dist/*.whl
dist/*.tar.gz
retention-days: 7
if-no-files-found: error

- name: Add built library link to the summary
if: inputs.kind == 'lib'
run: echo "[📦 Built library (wheel & sdist)](${{ steps.upload-lib.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY
shell: bash

- name: Add built library link to the pull-request
if: inputs.kind == 'lib' && steps.meta.outputs.is_pr
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
with:
message: "[📦 Built library (wheel & sdist)](${{ steps.upload-lib.outputs.artifact-url }})"
comment_tag: library