sintonia/.github/workflows/_python.yml

76 lines
1.7 KiB
YAML

on:
workflow_call:
inputs:
context:
required: true
type: string
lint:
required: false
default: true
type: boolean
test:
required: false
default: true
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
if: inputs.lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ inputs.context }}-${{ hashFiles(format('{0}/{1}', inputs.context, '**/setup.py')) }}
restore-keys: |
${{ runner.os }}-pip-${{ inputs.context }}
- name: Add annotations matchers
run: |
echo "::add-matcher::.github/annotations/pylint.json"
- name: Lint
run: make lint
working-directory: ${{ inputs.context }}
test:
if: inputs.test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release:
- buster
- bullseye
- bionic
- focal
- jammy
container: ghcr.io/libretime/libretime-dev:${{ matrix.release }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ inputs.context }}-${{ hashFiles(format('{0}/{1}', inputs.context, '**/setup.py')) }}
restore-keys: |
${{ runner.os }}-pip-${{ inputs.context }}
- name: Test
run: make test
working-directory: ${{ inputs.context }}