From 6d94f6f471336bb3a4d9a74bf26330e61670dcbc Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 11 Dec 2021 16:59:02 +0100 Subject: [PATCH 1/4] Added 'allow_failure' option for StaticTypeCheck job. --- .github/workflows/Parameters.yml | 2 +- .github/workflows/StaticTypeCheck.yml | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index f7b217d..c8c755c 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -36,7 +36,7 @@ on: default: '3.6 3.7 3.8 3.9 3.10' type: string name: - description: 'Name of the tool.' + description: 'Name of the tool/package.' required: true type: string outputs: diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index 115cc53..4165994 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -44,6 +44,11 @@ on: description: 'Commands to run the static type checks.' required: true type: string + allow_failure: + description: 'Allow a type checking to be failing without failing the overall workflow.' + required: false + default: false + type: boolean artifact: description: 'Name of the typing artifact.' required: true @@ -70,12 +75,12 @@ jobs: python -m pip install ${{ inputs.requirements }} - name: Check Static Typing - continue-on-error: true + continue-on-error: ${{ inputs.allow_failure }} run: ${{ inputs.commands }} - name: 📤 Upload 'Static Typing Report' artifact if: ${{ inputs.artifact != '' }} - continue-on-error: true + continue-on-error: ${{ inputs.allow_failure }} uses: actions/upload-artifact@v2 with: name: ${{ inputs.artifact }} From 85644b345682d0576902bc1b58dca396bb05ed37 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 11 Dec 2021 20:03:07 +0100 Subject: [PATCH 2/4] ExamplePipeline: add option 'allow_failure' to StaticTypeCheck --- ExamplePipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index 89e9754..9be2d54 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -70,6 +70,7 @@ jobs: python_version: ${{ fromJson(needs.Params.outputs.params).python_version }} requirements: '-r tests/requirements.txt' report: 'htmlmypy' + allow_failure: true PublishTestResults: uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@main From 5b2cd8f0774232fe5f45603a1ae70bf8ce2f1f2a Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 16 Dec 2021 06:38:03 +0100 Subject: [PATCH 3/4] Package: support either 'build' or 'setuptools' --- .github/workflows/Package.yml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index 91a5048..a559573 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -33,7 +33,7 @@ on: requirements: description: 'Python dependencies to be installed through pip.' required: false - default: 'wheel' + default: '' type: string artifact: description: 'Name of the package artifact.' @@ -55,17 +55,38 @@ jobs: with: python-version: ${{ inputs.python_version }} - - name: 🔧 Install dependencies for packaging and release - run: | - python -m pip install -U pip - python -m pip install ${{ inputs.requirements }} + - name: 🐍 Update pip + run: python -m pip install -U pip - - name: 🔨 Build Python package (source distribution) + # build + + - name: 🔧 [build] Install dependencies for packaging and release + if: inputs.requirements == '' + run: python -m pip install build + + - name: 🔨 [build] Build Python package (source distribution) + if: inputs.requirements == '' + run: python -m build --sdist + + - name: 🔨 [build] Build Python package (binary distribution - wheel) + if: inputs.requirements == '' + run: python -m build --wheel + + # setuptools + + - name: 🔧 [setuptools] Install dependencies for packaging and release + if: inputs.requirements != '' + run: python -m pip install ${{ inputs.requirements }} + + - name: 🔨 [setuptools] Build Python package (source distribution) + if: inputs.requirements != '' run: python setup.py sdist - - name: 🔨 Build Python package (binary distribution - wheel) + - name: 🔨 [setuptools] Build Python package (binary distribution - wheel) + if: inputs.requirements != '' run: python setup.py bdist_wheel + - name: 📤 Upload wheel artifact uses: actions/upload-artifact@v2 with: From 9255fdf781f70950975a5ce2ea2144dced6e07d5 Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 16 Dec 2021 06:59:16 +0100 Subject: [PATCH 4/4] Package: update description of option 'requirements --- .github/workflows/Package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index a559573..a662651 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -31,7 +31,7 @@ on: default: '3.10' type: string requirements: - description: 'Python dependencies to be installed through pip.' + description: 'Python dependencies to be installed through pip; if empty, use pyproject.toml through build.' required: false default: '' type: string