mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Trying artifact_cleanup.
This commit is contained in:
16
.github/workflows/Parameters.yml
vendored
16
.github/workflows/Parameters.yml
vendored
@@ -73,10 +73,10 @@ jobs:
|
||||
Parameters:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
python_version: ${{ steps.params.outputs.python_version }}
|
||||
python_jobs: ${{ steps.params.outputs.python_jobs }}
|
||||
artifact_names: ${{ steps.params.outputs.artifact_names }}
|
||||
params: ${{ steps.params.outputs.params }}
|
||||
python_version: ${{ steps.params.outputs.python_version }}
|
||||
python_jobs: ${{ steps.params.outputs.python_jobs }}
|
||||
artifact_names: ${{ steps.params.outputs.artifact_names }}
|
||||
params: ${{ steps.params.outputs.params }}
|
||||
|
||||
steps:
|
||||
- name: Generate 'params' and 'python_jobs'
|
||||
@@ -236,15 +236,13 @@ jobs:
|
||||
|
||||
print("Parameters:")
|
||||
print(f" python_version: {python_version}")
|
||||
print(f" python_jobs ({len(jobs)}):\n" +
|
||||
"".join([f" {{ " + ", ".join([f"\"{key}\": \"{value}\"" for key, value in job.items()]) + f" }},\n" for job in jobs])
|
||||
)
|
||||
print(f" artifact_names ({len(artifact_names)}):")
|
||||
for id, name in artifact_names.items():
|
||||
print(f" {id:>14}: {name}")
|
||||
|
||||
buffer = "".join([f" {{ " + ", ".join([f"\"{key}\": \"{value}\"" for key, value in job.items()]) + f" }},\n" for job in jobs])
|
||||
print(dedent(f"""\
|
||||
Python jobs ({len(jobs)}):
|
||||
{buffer}"""))
|
||||
|
||||
# Write jobs to special file
|
||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||
print(f"GITHUB_OUTPUT: {github_output}")
|
||||
|
||||
61
.github/workflows/_Checking_ArtifactCleanup.yml
vendored
Normal file
61
.github/workflows/_Checking_ArtifactCleanup.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Verification Pipeline for ArtifactCleanup
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
Params:
|
||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
|
||||
with:
|
||||
name: Example
|
||||
python_version_list: "3.10 3.11"
|
||||
system_list: "ubuntu windows"
|
||||
|
||||
Testing:
|
||||
name: Artifact generation ${{ matrix.system }}-${{ matrix.python }}
|
||||
needs:
|
||||
- Params
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
strategy:
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.Params.outputs.python_jobs) }}
|
||||
steps:
|
||||
- name: Content creation for ${{ matrix.system }}-${{ matrix.python }}
|
||||
run: echo "${{ matrix.runs-on }}-${{ matrix.python }}" >> artifact.txt
|
||||
|
||||
- name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-${{ matrix.system }}-${{ matrix.python }}
|
||||
path: artifact.txt
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
Package:
|
||||
name: Package generation
|
||||
needs:
|
||||
- Params
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Package creation
|
||||
run: echo "Package" >> package.txt
|
||||
|
||||
- name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
||||
path: package.txt
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
ArtifactCleanUp:
|
||||
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev
|
||||
needs:
|
||||
- Params
|
||||
- Testing
|
||||
- Package
|
||||
with:
|
||||
package: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
||||
remaining: |
|
||||
${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-*
|
||||
Reference in New Issue
Block a user