mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 19:16:57 +08:00
add reusable workflows
This commit is contained in:
115
ExamplePipeline.yml
Normal file
115
ExamplePipeline.yml
Normal file
@@ -0,0 +1,115 @@
|
||||
name: Unit Testing, Coverage Collection, Package, Release, Documentation and Publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
# This job is a workaround for global variables
|
||||
# See https://github.com/actions/runner/issues/480
|
||||
Params:
|
||||
uses: pyTooling/Actions/.github/workflows/Params.yml@dev
|
||||
with:
|
||||
name: ToolName
|
||||
|
||||
UnitTesting:
|
||||
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
|
||||
with:
|
||||
TestReport: true
|
||||
|
||||
Coverage:
|
||||
uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev
|
||||
needs:
|
||||
- Params
|
||||
with:
|
||||
pyver: ${{ fromJson(needs.Params.outputs.params).pyver }}
|
||||
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
||||
secrets:
|
||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
|
||||
StaticTypeCheck:
|
||||
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev
|
||||
needs:
|
||||
- Params
|
||||
with:
|
||||
package: ${{ fromJson(needs.Params.outputs.params).package }}
|
||||
pyver: ${{ fromJson(needs.Params.outputs.params).pyver }}
|
||||
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
||||
|
||||
Release:
|
||||
uses: pyTooling/Actions/.github/workflows/Release.yml@dev
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
needs:
|
||||
- UnitTesting
|
||||
- Coverage
|
||||
- StaticTypeCheck
|
||||
|
||||
Package:
|
||||
uses: pyTooling/Actions/.github/workflows/Package.yml@dev
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
needs:
|
||||
- Params
|
||||
- Coverage
|
||||
with:
|
||||
pyver: ${{ fromJson(needs.Params.outputs.params).pyver }}
|
||||
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.wheel }}
|
||||
|
||||
PublishOnPyPI:
|
||||
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
needs:
|
||||
- Params
|
||||
- Release
|
||||
- Package
|
||||
with:
|
||||
pyver: ${{ fromJson(needs.Params.outputs.params).pyver }}
|
||||
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.wheel }}
|
||||
secrets:
|
||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
|
||||
VerifyDocs:
|
||||
uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev
|
||||
needs:
|
||||
- Params
|
||||
with:
|
||||
pyver: ${{ fromJson(needs.Params.outputs.params).pyver }}
|
||||
|
||||
BuildTheDocs:
|
||||
uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@dev
|
||||
needs:
|
||||
- Params
|
||||
- VerifyDocs
|
||||
with:
|
||||
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
|
||||
|
||||
PublishToGitHubPages:
|
||||
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev
|
||||
needs:
|
||||
- Params
|
||||
- BuildTheDocs
|
||||
- Coverage
|
||||
- StaticTypeCheck
|
||||
with:
|
||||
doc: ${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
|
||||
coverage: ${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
||||
typing: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
||||
|
||||
|
||||
ArtifactCleanUp:
|
||||
name: 🗑️ Artifact Cleanup
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- Params
|
||||
- Coverage
|
||||
- StaticTypeCheck
|
||||
- BuildTheDocs
|
||||
- PublishToGitHubPages
|
||||
|
||||
steps:
|
||||
- name: 🗑️ Delete all Artifacts
|
||||
uses: geekyeggo/delete-artifact@v1
|
||||
with:
|
||||
name: |
|
||||
${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
|
||||
${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
||||
${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
|
||||
Reference in New Issue
Block a user