ci: fine grained test release (#3171)
### Description Allow fine grained configuration on which release the test should be run. This will be useful to start testing liquidsoap >=2.0.0 in our ci.
This commit is contained in:
parent
63ff50b82c
commit
23917f7d8f
34
.github/workflows/_python-lint.yml
vendored
Normal file
34
.github/workflows/_python-lint.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
context:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-lint
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- uses: actions/cache@v4
|
||||
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 }}
|
||||
46
.github/workflows/_python-test.yml
vendored
Normal file
46
.github/workflows/_python-test.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
context:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
release:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-test-${{ inputs.release }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: ghcr.io/libretime/libretime-dev:${{ inputs.release }}
|
||||
options: --user 1001:1001
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ inputs.release }}-pip-${{ inputs.context }}-${{ hashFiles(format('{0}/{1}', inputs.context, '**/setup.py')) }}
|
||||
restore-keys: |
|
||||
${{ inputs.release }}-pip-${{ inputs.context }}
|
||||
|
||||
- name: Test
|
||||
run: make test-coverage
|
||||
working-directory: ${{ inputs.context }}
|
||||
|
||||
- name: Report coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: ${{ inputs.context }}/coverage.xml
|
||||
flags: ${{ inputs.context }}
|
||||
name: ${{ inputs.context }}
|
||||
84
.github/workflows/_python.yml
vendored
84
.github/workflows/_python.yml
vendored
@ -1,84 +0,0 @@
|
||||
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@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- uses: actions/cache@v4
|
||||
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
|
||||
- bullseye
|
||||
- jammy
|
||||
|
||||
container:
|
||||
image: ghcr.io/libretime/libretime-dev:${{ matrix.release }}
|
||||
options: --user 1001:1001
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ matrix.release }}-pip-${{ inputs.context }}-${{ hashFiles(format('{0}/{1}', inputs.context, '**/setup.py')) }}
|
||||
restore-keys: |
|
||||
${{ matrix.release }}-pip-${{ inputs.context }}
|
||||
|
||||
- name: Test
|
||||
run: make test-coverage
|
||||
working-directory: ${{ inputs.context }}
|
||||
|
||||
- name: Report coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: ${{ inputs.context }}/coverage.xml
|
||||
flags: ${{ inputs.context }}
|
||||
name: ${{ inputs.context }}
|
||||
26
.github/workflows/analyzer.yml
vendored
26
.github/workflows/analyzer.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/analyzer.yml
|
||||
- analyzer/**
|
||||
- shared/**
|
||||
@ -14,7 +14,7 @@ on:
|
||||
pull_request:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/analyzer.yml
|
||||
- analyzer/**
|
||||
- shared/**
|
||||
@ -24,7 +24,25 @@ on:
|
||||
- cron: 0 1 * * 1
|
||||
|
||||
jobs:
|
||||
python:
|
||||
uses: ./.github/workflows/_python.yml
|
||||
lint:
|
||||
uses: ./.github/workflows/_python-lint.yml
|
||||
with:
|
||||
context: analyzer
|
||||
|
||||
test-focal:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: analyzer
|
||||
release: focal
|
||||
|
||||
test-bullseye:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: analyzer
|
||||
release: bullseye
|
||||
|
||||
test-jammy:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: analyzer
|
||||
release: jammy
|
||||
|
||||
26
.github/workflows/api-client.yml
vendored
26
.github/workflows/api-client.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/api-client.yml
|
||||
- api-client/**
|
||||
- shared/**
|
||||
@ -14,7 +14,7 @@ on:
|
||||
pull_request:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/api-client.yml
|
||||
- api-client/**
|
||||
- shared/**
|
||||
@ -24,7 +24,25 @@ on:
|
||||
- cron: 0 1 * * 1
|
||||
|
||||
jobs:
|
||||
python:
|
||||
uses: ./.github/workflows/_python.yml
|
||||
lint:
|
||||
uses: ./.github/workflows/_python-lint.yml
|
||||
with:
|
||||
context: api-client
|
||||
|
||||
test-focal:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: api-client
|
||||
release: focal
|
||||
|
||||
test-bullseye:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: api-client
|
||||
release: bullseye
|
||||
|
||||
test-jammy:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: api-client
|
||||
release: jammy
|
||||
|
||||
9
.github/workflows/api.yml
vendored
9
.github/workflows/api.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/api.yml
|
||||
- api/**
|
||||
- shared/**
|
||||
@ -14,7 +14,7 @@ on:
|
||||
pull_request:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/api.yml
|
||||
- api/**
|
||||
- shared/**
|
||||
@ -24,11 +24,10 @@ on:
|
||||
- cron: 0 1 * * 1
|
||||
|
||||
jobs:
|
||||
python:
|
||||
uses: ./.github/workflows/_python.yml
|
||||
lint:
|
||||
uses: ./.github/workflows/_python-lint.yml
|
||||
with:
|
||||
context: api
|
||||
test: false
|
||||
|
||||
test-with-database:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
26
.github/workflows/playout.yml
vendored
26
.github/workflows/playout.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/playout.yml
|
||||
- playout/**
|
||||
- api-client/**
|
||||
@ -15,7 +15,7 @@ on:
|
||||
pull_request:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/playout.yml
|
||||
- playout/**
|
||||
- api-client/**
|
||||
@ -26,7 +26,25 @@ on:
|
||||
- cron: 0 1 * * 1
|
||||
|
||||
jobs:
|
||||
python:
|
||||
uses: ./.github/workflows/_python.yml
|
||||
lint:
|
||||
uses: ./.github/workflows/_python-lint.yml
|
||||
with:
|
||||
context: playout
|
||||
|
||||
test-focal:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: playout
|
||||
release: focal
|
||||
|
||||
test-bullseye:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: playout
|
||||
release: bullseye
|
||||
|
||||
test-jammy:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: playout
|
||||
release: jammy
|
||||
|
||||
26
.github/workflows/shared.yml
vendored
26
.github/workflows/shared.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/shared.yml
|
||||
- shared/**
|
||||
- tools/python*
|
||||
@ -13,7 +13,7 @@ on:
|
||||
pull_request:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/shared.yml
|
||||
- shared/**
|
||||
- tools/python*
|
||||
@ -22,7 +22,25 @@ on:
|
||||
- cron: 0 1 * * 1
|
||||
|
||||
jobs:
|
||||
python:
|
||||
uses: ./.github/workflows/_python.yml
|
||||
lint:
|
||||
uses: ./.github/workflows/_python-lint.yml
|
||||
with:
|
||||
context: shared
|
||||
|
||||
test-focal:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: shared
|
||||
release: focal
|
||||
|
||||
test-bullseye:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: shared
|
||||
release: bullseye
|
||||
|
||||
test-jammy:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: shared
|
||||
release: jammy
|
||||
|
||||
26
.github/workflows/worker.yml
vendored
26
.github/workflows/worker.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/worker.yml
|
||||
- worker/**
|
||||
- tools/python*
|
||||
@ -13,7 +13,7 @@ on:
|
||||
pull_request:
|
||||
branches: [main, stable-*]
|
||||
paths:
|
||||
- .github/workflows/_python.yml
|
||||
- .github/workflows/_python-*.yml
|
||||
- .github/workflows/worker.yml
|
||||
- worker/**
|
||||
- tools/python*
|
||||
@ -22,7 +22,25 @@ on:
|
||||
- cron: 0 1 * * 1
|
||||
|
||||
jobs:
|
||||
python:
|
||||
uses: ./.github/workflows/_python.yml
|
||||
lint:
|
||||
uses: ./.github/workflows/_python-lint.yml
|
||||
with:
|
||||
context: worker
|
||||
|
||||
test-focal:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: worker
|
||||
release: focal
|
||||
|
||||
test-bullseye:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: worker
|
||||
release: bullseye
|
||||
|
||||
test-jammy:
|
||||
uses: ./.github/workflows/_python-test.yml
|
||||
with:
|
||||
context: worker
|
||||
release: jammy
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user