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

Adding svn validations basic flow #1

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
10d2269
adding svn validations basic flow
gopidesupavan Dec 1, 2024
f77a114
update names
gopidesupavan Dec 1, 2024
164a1d1
remove echo
gopidesupavan Dec 1, 2024
ca41ee7
update tests
gopidesupavan Dec 1, 2024
add8003
adding signature check
gopidesupavan Dec 1, 2024
9c8703a
fix workspace name
gopidesupavan Dec 1, 2024
bb946f5
adding subsection actions
gopidesupavan Dec 7, 2024
0779890
add unit tests for svn check
gopidesupavan Dec 7, 2024
94b2215
add unit tests to check-sum
gopidesupavan Dec 7, 2024
7eea894
add pypi publish and tests
gopidesupavan Dec 8, 2024
bf17e47
update variables
gopidesupavan Dec 8, 2024
9db2dc5
update paths
gopidesupavan Dec 8, 2024
c43752f
update repo path
gopidesupavan Dec 8, 2024
b9d3465
add initial readme file
gopidesupavan Dec 8, 2024
cce1d2f
add tests to signature check
gopidesupavan Dec 9, 2024
d180e37
add python-gnupg module to tests
gopidesupavan Dec 9, 2024
45e96b9
add requests module to tests
gopidesupavan Dec 9, 2024
03e48d6
use pytest-unordered
gopidesupavan Dec 9, 2024
8025fa5
use pytest-unordered
gopidesupavan Dec 9, 2024
6e1ec93
log updates
gopidesupavan Dec 9, 2024
481a1b6
adding doc string and fixing lints
gopidesupavan Dec 9, 2024
1edb0d4
remove fromjson for non json outputs
gopidesupavan Dec 10, 2024
6883637
update sample workflow usage as per best practice suggestion
gopidesupavan Dec 10, 2024
0259bcf
update sample workflow usage as per best practice suggestion
gopidesupavan Dec 10, 2024
5af7723
rename action
gopidesupavan Dec 12, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test actions scripts
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: "Run tests"
run: |
python3 -m pip install uv pytest rich python-gnupg requests pytest-unordered
uv run pytest -vv
153 changes: 153 additions & 0 deletions .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Tes gh-svn-pypi-publisher
description: "Publish to PyPI"

on:
workflow_dispatch:
inputs:
release-config:
description: "Path to the release config file"
required: true
default: "release-config.yml"
temp-dir:
description: >
Checkout directory of svn repo, this is used to checkout the svn repo.
required: false
default: "asf-dist"
mode:
description: "Mode to run the action"
required: false
default: "VERIFY"
if-no-files-found:
description: >
The desired behavior if no files are found using the provided path.

Available Options:
warn: Output a warning but do not fail the action
error: Fail the action with an error message
ignore: Do not output any warnings or errors, the action does not fail
default: 'warn'
retention-days:
description: >
Duration after which artifact will expire in days. 0 means using default retention.

Minimum 1 day.
Maximum 90 days unless changed from the repository settings page.
default: '5'
compression-level:
description: >
The level of compression for Zlib to be applied to the artifact archive.
The value can range from 0 to 9:
- 0: No compression
- 1: Best speed
- 6: Default compression (same as GNU Gzip)
- 9: Best compression
Higher levels will result in better compression, but will take longer to complete.
For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
default: '6'
overwrite:
description: >
If true, an artifact with a matching name will be deleted before a new one is uploaded.
If false, the action will fail if an artifact for the given name already exists.
Does not fail if the artifact does not exist.
default: 'false'

artifact-name:
description: >
The name of the artifact to be uploaded.
required: false
default: "pypi-packages"



jobs:
release-checks:
outputs:
publisher-name: ${{ steps.config-parser.outputs.publisher-name }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: "Config parser"
id: config-parser
uses: ./read-config
with:
release-config: ${{ inputs.release-config }}

- name: "Checkout svn ${{ steps.config-parser.outputs.publisher-url }}"
id: "svn-checkout"
uses: ./init
with:
temp-dir: ${{ inputs.temp-dir }}
repo-url: ${{ steps.config-parser.outputs.publisher-url }}
repo-path: ${{ steps.config-parser.outputs.publisher-path }}

- name: "Svn check"
id: "svn-check"
uses: ./svn
with:
svn-config: ${{ steps.config-parser.outputs.checks-svn }}
temp-dir: ${{ inputs.temp-dir }}
repo-path: ${{ steps.config-parser.outputs.publisher-path }}

- name: "Checksum check"
id: "checksum-check"
uses: ./checksum
with:
checksum-config: ${{ steps.config-parser.outputs.checks-checksum }}
temp-dir: ${{ inputs.temp-dir }}
repo-path: ${{ steps.config-parser.outputs.publisher-path }}

- name: "Signature check"
id: "signature-check"
uses: ./signature
with:
signature-config: ${{ steps.config-parser.outputs.checks-signature }}
temp-dir: ${{ inputs.temp-dir }}
repo-path: ${{ steps.config-parser.outputs.publisher-path }}

- name: "Find ${{ steps.config-parser.outputs.publisher-name }} packages"
id: "upload-artifacts"
uses: ./artifacts
with:
publish-config: ${{ steps.config-parser.outputs.checks-publish }}
temp-dir: ${{ inputs.temp-dir }}
mode: ${{ inputs.mode }}
publisher-name: ${{ steps.config-parser.outputs.publisher-name }}
repo-path: ${{ steps.config-parser.outputs.publisher-path }}
if-no-files-found: ${{ inputs.if-no-files-found }}
retention-days: ${{ inputs.retention-days }}
compression-level: ${{ inputs.compression-level }}
overwrite: ${{ inputs.overwrite }}


publish-to-pypi:
name: Publish svn packages to PyPI
runs-on: ubuntu-latest
needs:
- release-checks
environment:
name: test
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: "Download release distributions for ${{ needs.release-checks.outputs.publisher-name }}"
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
merge-multiple: true
path: ./dist

- name: "Publishing ${{ needs.release-checks.outputs.publisher-name }} to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
if: inputs.mode == 'RELEASE'
with:
packages-dir: "./dist"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*./__pycache__/.*
Loading
Loading