Setting simple CI #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow | |
# https://docs.github.com/fr/actions/using-workflows/workflow-syntax-for-github-actions#exemple--inclusion-de-chemins-dacc%C3%A8s | |
name: Full CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
run-integration-tests: | |
description: 'If integration test should be run' | |
required: true | |
type: boolean | |
default: false | |
use-cache: | |
description: 'If cache should be used' | |
required: true | |
type: boolean | |
default: true | |
is-dispatch: | |
description: 'Just to identify manual dispatch' | |
required: true | |
type: boolean | |
default: true | |
workflow_call: | |
inputs: | |
run-integration-tests: | |
description: 'If integration test should be run' | |
required: true | |
type: boolean | |
default: false | |
use-cache: | |
description: 'If cache should be used' | |
required: true | |
type: boolean | |
default: false | |
# Concurrency : auto-cancel "old" jobs ie when pushing again | |
# https://docs.github.com/fr/actions/using-jobs/using-concurrency | |
concurrency: | |
group: ${{ github.workflow }}-${{ inputs.run-integration-tests }}-${{ inputs.is-dispatch }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-python: | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # Do not stop when any job fails | |
matrix: | |
python-version: [ "3.10", "3.11" ] | |
os: [ubuntu-latest] | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
continue-on-error: false # https://ncorti.com/blog/howto-github-actions-build-matrix | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: true | |
- name: Install dependencies | |
run: pdm install -G :all | |
- name: Verify linting, format | |
run: pdm check-format | |
- name: Test code | |
run: pdm test | |
- name: Build | |
run: pdm build | |
- name: "Python client: archive built artifacts" | |
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*whl |