Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Oct 24, 2023
1 parent ac5c5ce commit 9b21e1d
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_pkg_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
run: pipx run twine check dist/*

build-wheels:
name: 'Native Binary Distribution / ${{ matrix.os }}'
name: 'Native Binary Distribution: ${{ matrix.os }}'
if: fromJSON(inputs.metadata).package.pure_python == false
runs-on: ${{ matrix.platform.runner }}
strategy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_pkg_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
category: "bandit"

mypy:
name: 'MyPy / Python ${{ matrix.python-version }} / ${{ matrix.os }}'
name: 'MyPy (${{ matrix.os }}, Py ${{ matrix.python-version }})'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
path: ${{ fromJSON(inputs.metadata).path.dir.local }}/.temp

pylint:
name: 'PyLint / ${{ matrix.os }}'
name: 'PyLint (${{ matrix.os }})'
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_pkg_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
jobs:

test:
name: 'Python ${{ matrix.python-version }} / ${{ matrix.os }}'
name: '${{ matrix.os }} - Py ${{ matrix.python-version }}'
strategy:
fail-fast: false
matrix:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/_repodynamics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: '[Callable]: RepoDynamics'

on:
workflow_call:
inputs:
meta-sync:
type: string
default: report
required: false
description: |
The action to take when the dynamic files are out of sync with the repository meta content.
Selecting 'none' will disable this action.
hooks:
type: string
default: report
required: false
description: |
The action to take when running the workflow hooks.
Selecting 'none' will disable this action.
package-build:
type: boolean
required: false
default: false
description: |
Build the package and upload the builds as artifacts.
package-lint:
type: boolean
required: false
default: false
description: |
Run the linting workflow.
package-test:
type: boolean
required: false
default: false
description: |
Run the test workflow on package.
website-build:
type: boolean
required: false
default: false
description: |
Build the documentation with Sphinx and upload the builds as artifacts.
outputs:
config: ${{ jobs.init.outputs.config }}
metadata: ${{ jobs.init.outputs.metadata }}

jobs:
init:
name: 'Init'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
config: ${{ steps.init.outputs.config }}
metadata: ${{ steps.init.outputs.metadata-ci }}
steps:
- id: init
uses: repodynamics/init@main
with:
admin-token: ${{ secrets.REPO_ADMIN_TOKEN }}
package-build: ${{ inputs.package-build }}
package-lint: ${{ inputs.package-lint }}
package-test: ${{ inputs.package-test }}
website-build: ${{ inputs.website-build }}
meta-sync: ${{ inputs.meta-sync }}
hooks: ${{ inputs.hooks }}

init-fail:
name: 'Status'
runs-on: ubuntu-latest
needs: init
steps:
- run: |
if [ "${{ fromJSON(needs.init.outputs.config).fail }}" = "true" ]; then
exit 1
else
exit 0
fi
43 changes: 11 additions & 32 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,18 @@ on:
Build the documentation with Sphinx and upload the builds as artifacts.
jobs:
init:
name: 'RepoDynamics / Init'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
config: ${{ steps.init.outputs.config }}
metadata: ${{ steps.init.outputs.metadata-ci }}
steps:
- id: init
uses: repodynamics/init@main
with:
admin-token: ${{ secrets.REPO_ADMIN_TOKEN }}
package-build: ${{ inputs.package-build }}
package-lint: ${{ inputs.package-lint }}
package-test: ${{ inputs.package-test }}
website-build: ${{ inputs.website-build }}
meta-sync: ${{ inputs.meta-sync }}
hooks: ${{ inputs.hooks }}

init-fail:
name: 'RepoDynamics / Status'
runs-on: ubuntu-latest
needs: init
steps:
- run: |
if [ "${{ fromJSON(needs.init.outputs.config).fail }}" = "true" ]; then
exit 1
else
exit 0
fi
init:
name: 'RepoDynamics'
uses: ./.github/workflows/_repodynamics.yaml
with:
admin-token: ${{ secrets.REPO_ADMIN_TOKEN }}
package-build: ${{ inputs.package-build }}
package-lint: ${{ inputs.package-lint }}
package-test: ${{ inputs.package-test }}
website-build: ${{ inputs.website-build }}
meta-sync: ${{ inputs.meta-sync }}
hooks: ${{ inputs.hooks }}

build:
name: 'Package Build'
Expand Down

0 comments on commit 9b21e1d

Please sign in to comment.