2022-04-25 15:27:10 +02:00
|
|
|
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:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-20 05:08:55 +01:00
|
|
|
- uses: actions/setup-python@v5
|
2022-06-09 09:50:36 +02:00
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2024-01-19 18:05:01 +01:00
|
|
|
- uses: actions/cache@v4
|
2022-04-25 15:27:10 +02:00
|
|
|
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:
|
|
|
|
- focal
|
2022-09-09 20:45:59 +02:00
|
|
|
- bullseye
|
2022-04-25 15:27:10 +02:00
|
|
|
- jammy
|
|
|
|
|
2022-06-18 15:54:16 +02:00
|
|
|
container:
|
|
|
|
image: ghcr.io/libretime/libretime-dev:${{ matrix.release }}
|
2022-08-13 20:24:28 +02:00
|
|
|
options: --user 1001:1001
|
2022-04-25 15:27:10 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
steps:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-25 15:27:10 +02:00
|
|
|
|
2024-01-19 18:05:01 +01:00
|
|
|
- uses: actions/cache@v4
|
2022-04-25 15:27:10 +02:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
2022-06-18 15:54:16 +02:00
|
|
|
key: ${{ matrix.release }}-pip-${{ inputs.context }}-${{ hashFiles(format('{0}/{1}', inputs.context, '**/setup.py')) }}
|
2022-04-25 15:27:10 +02:00
|
|
|
restore-keys: |
|
2022-06-18 15:54:16 +02:00
|
|
|
${{ matrix.release }}-pip-${{ inputs.context }}
|
2022-04-25 15:27:10 +02:00
|
|
|
|
|
|
|
- name: Test
|
2022-12-07 11:42:16 +01:00
|
|
|
run: make test-coverage
|
2022-04-25 15:27:10 +02:00
|
|
|
working-directory: ${{ inputs.context }}
|
2022-06-24 20:47:23 +02:00
|
|
|
|
|
|
|
- name: Report coverage
|
2024-02-05 02:53:43 +01:00
|
|
|
uses: codecov/codecov-action@v4
|
2022-06-24 20:47:23 +02:00
|
|
|
with:
|
|
|
|
files: ${{ inputs.context }}/coverage.xml
|
2022-06-29 12:18:36 +02:00
|
|
|
flags: ${{ inputs.context }}
|
2022-06-24 20:47:23 +02:00
|
|
|
name: ${{ inputs.context }}
|