Repository navigation
109 lines (95 loc) · 3.85 KB
/
Copy path_Checking_Components.yml
File metadata and controls
109 lines (95 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Verification of Components
run-name: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
# Pairs of jobs, each verifying one component - an action or a job template - in isolation.
on:
push:
# 'update/rN' carries a version branch's rewritten references; only 'Pipeline.yml' runs there.
branches-ignore:
- 'update/**'
tags:
- '**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
jobs:
Package:
uses: pyTooling/Actions/.github/workflows/Package.yml@dev
with:
artifact: Components-Package
PackageCompliance:
name: 🔍 Check 'pypi_compliant' of Package
runs-on: ubuntu-26.04
needs:
- Package
steps:
- name: Check that the example package is reported as not PyPI-compliant
env:
PYPI_COMPLIANT: ${{ needs.Package.outputs.pypi_compliant }}
run: |
printf -- 'pypi_compliant: %s\n' "${PYPI_COMPLIANT}"
if [[ "${PYPI_COMPLIANT}" == "" ]]; then
printf -- "::notice title=PackageCompliance::'Package.yml@dev' has no output 'pypi_compliant' yet.\n"
elif [[ "${PYPI_COMPLIANT}" != "true" ]]; then
printf -- "::error title=PackageCompliance::Expected 'true', got '%s'.\n" "${PYPI_COMPLIANT}"
exit 1
fi
- name: 🗑️ Delete the package artifact
uses: geekyeggo/delete-artifact@v6
with:
name: Components-Package
PyPIComplianceAction:
name: 🔍 Check action 'InspectPyPICompliance'
runs-on: ubuntu-26.04
steps:
- name: Checkout repository to access local Action
uses: actions/checkout@v7
- name: 🐍 Setup Python 3.15
uses: actions/setup-python@v7
with:
python-version: '3.15'
- name: Build a clean and a dirty fixture package
run: |
python -m pip install --disable-pip-version-check build
writeFixture() { # <kind> <extras_require>
local kind="$1" extras="$2"
mkdir -p "fixtures/${kind}"
printf -- '%s\n' \
'from setuptools import setup' \
'' \
"setup(name=\"fixture_${kind}\", version=\"1.0.0\", py_modules=[], extras_require=${extras})" \
> "fixtures/${kind}/setup.py"
if ! python -m build --outdir "fixtures/${kind}/dist" "fixtures/${kind}"; then
printf -- "::error title=PyPIComplianceAction::Building the %s fixture failed.\n" "${kind}"
exit 1
fi
}
reference='fixture_dependency @ git+https://github.com/pyTooling/Actions.git@dev'
writeFixture "clean" '{"doc": ["sphinx"]}'
writeFixture "dirty" "{\"doc\": [\"sphinx\", \"${reference}\"], \"all\": [\"${reference}\"]}"
- name: Check the clean fixture
id: clean
uses: ./.github/actions/InspectPyPICompliance
with:
directory: fixtures/clean/dist
- name: Check the dirty fixture
id: dirty
uses: ./.github/actions/InspectPyPICompliance
with:
directory: fixtures/dirty/dist
- name: Check the action's verdicts
env:
CLEAN: ${{ steps.clean.outputs.pypi_compliant }}
DIRTY: ${{ steps.dirty.outputs.pypi_compliant }}
run: |
errors=0
printf -- 'clean: %s, dirty: %s\n' "${CLEAN}" "${DIRTY}"
if [[ "${CLEAN}" != "true" ]]; then
printf -- "::error title=PyPIComplianceAction::Clean fixture: expected 'true', got '%s'.\n" "${CLEAN}"
errors=$((errors + 1))
fi
if [[ "${DIRTY}" != "false" ]]; then
printf -- "::error title=PyPIComplianceAction::Dirty fixture: expected 'false', got '%s'.\n" "${DIRTY}"
errors=$((errors + 1))
fi
[[ ${errors} -eq 0 ]] || exit 1