add reusable workflows

This commit is contained in:
umarcor
2021-11-22 02:07:12 +01:00
parent 7647c96c79
commit 35738eef8f
11 changed files with 633 additions and 0 deletions

42
.github/workflows/Params.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Params
on:
workflow_call:
inputs:
pyver:
description: 'Python version.'
required: false
default: '3.10'
type: string
name:
description: 'Name of the tool.'
required: true
type: string
outputs:
params:
description: "Parameters to be used in other jobs."
value: ${{ jobs.Params.outputs.params }}
jobs:
Params:
runs-on: ubuntu-latest
outputs:
params: ${{ steps.params.outputs.params }}
steps:
- id: params
shell: python
run: |
name = '${{ inputs.name }}'
params = {
'package': name,
'pyver': '${{ inputs.pyver }}',
'artifacts': {
'coverage': f'{name}-coverage',
'typing': f'{name}-typing',
'wheel': f'{name}-wheel',
'doc': f'{name}-doc',
}
}
print(f'::set-output name=params::{params!s}')