Setup CI for adapter with service dependencies #1136
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
name: Build Status | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
paths-ignore: | |
- LICENSE | |
- NOTICE | |
- README.md | |
- "docs/**" | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- LICENSE | |
- NOTICE | |
- README.md | |
- "docs/**" | |
workflow_dispatch: | |
inputs: | |
ci-full: | |
description: "Run Full CI" | |
required: false | |
type: boolean | |
default: false | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
checks: write | |
pull-requests: write | |
id-token: write # for pypi test release | |
jobs: | |
######################################################## | |
#......................................................# | |
#..|########|..|###\.....|##|..|########|..|########|..# | |
#.....|##|.....|##|##\...|##|.....|##|.....|########|..# | |
#.....|##|.....|##|\##\..|##|.....|##|........|##|.....# | |
#.....|##|.....|##|.\##\.|##|.....|##|........|##|.....# | |
#.....|##|.....|##|..\##\|##|.....|##|........|##|.....# | |
#.....|##|.....|##|...\##\#/......|##|........|##|.....# | |
#..|########|..|##|....\##/....|########|.....|##|.....# | |
#......................................................# | |
######################################################## | |
# Stage One - Initialize the build # | |
######################################################## | |
# This is so we can inspect the latest commit message from | |
# both push and pull_request events (there is no | |
# github.event.head_commit.message otherwise on pull | |
# requests) | |
initialize: | |
runs-on: ubuntu-24.04 | |
outputs: | |
COMMIT_MESSAGE: ${{ steps.setup.outputs.COMMIT_MSG }} | |
FULL_RUN: ${{ steps.setuppush.outputs.FULL_RUN || steps.setuppr.outputs.FULL_RUN || steps.setupmanual.outputs.FULL_RUN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# for pull_request so we can do HEAD^2 | |
fetch-depth: 2 | |
- name: Get Commit Message | |
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B HEAD | tr '\n' ' ')" >> $GITHUB_ENV | |
if: ${{ github.event_name == 'push' }} | |
- name: Get Commit Message | |
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B HEAD^2 | tr '\n' ' ')" >> $GITHUB_ENV | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: Display and Setup Build Args (Push) | |
id: setuppush | |
run: | | |
echo "Commit Message: $COMMIT_MSG" | |
echo "Full Run: $FULL_RUN" | |
echo "COMMIT_MSG=$COMMIT_MSG" >> $GITHUB_OUTPUT | |
echo "FULL_RUN=$FULL_RUN" >> $GITHUB_OUTPUT | |
env: | |
FULL_RUN: ${{ startsWith(github.ref_name, 'v') || contains(github.event.head_commit.message, '[ci-full]') }} | |
if: ${{ github.event_name == 'push' }} | |
- name: Display and Setup Build Args (PR) | |
id: setuppr | |
run: | | |
echo "Commit Message: $COMMIT_MSG" | |
echo "Full Run: $FULL_RUN" | |
echo "COMMIT_MSG=$COMMIT_MSG" >> $GITHUB_OUTPUT | |
echo "FULL_RUN=$FULL_RUN" >> $GITHUB_OUTPUT | |
env: | |
FULL_RUN: ${{ contains(github.event.pull_request.title, '[ci-full]') || contains(env.COMMIT_MSG, '[ci-full]') }} | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: Display and Setup Build Args (Manual) | |
id: setupmanual | |
run: | | |
echo "Commit Message: $COMMIT_MSG" | |
echo "Full Run: $FULL_RUN" | |
echo "COMMIT_MSG=$COMMIT_MSG" >> $GITHUB_OUTPUT | |
echo "FULL_RUN=$FULL_RUN" >> $GITHUB_OUTPUT | |
env: | |
FULL_RUN: ${{ github.event.inputs.ci-full }} | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
######################################################## | |
#......................................................# | |
#..|##|........|########|..|###\.....|##|..|########|..# | |
#..|##|...........|##|.....|##|##\...|##|..|########|..# | |
#..|##|...........|##|.....|##|\##\..|##|.....|##|.....# | |
#..|##|...........|##|.....|##|.\##\.|##|.....|##|.....# | |
#..|##|...........|##|.....|##|..\##\|##|.....|##|.....# | |
#..|########|.....|##|.....|##|...\##\#/......|##|.....# | |
#..|########|..|########|..|##|....\##/.......|##|.....# | |
#......................................................# | |
######################################################## | |
# Stage One - Lint Python / C++ # | |
######################################################## | |
lint: | |
needs: | |
- initialize | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 | |
python-version: | |
- 3.9 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Install python dependencies | |
run: make requirements | |
- name: Python Lint Steps (Linux) | |
run: make lint | |
################################################################ | |
#..............................................................# | |
#..|########\..|##|..|##|..|########|..|##|........|#######\...# | |
#..|##|../##/..|##|..|##|.....|##|.....|##|........|##|..\##\..# | |
#..|##|./##/...|##|..|##|.....|##|.....|##|........|##|..|##|..# | |
#..|##||#<.....|##|..|##|.....|##|.....|##|........|##|..|##|..# | |
#..|##|.\##\...|##|..|##|.....|##|.....|##|........|##|..|##|..# | |
#..|##|..\##\..|##|..|##|.....|##|.....|########|..|##|../##/..# | |
#..|########/..|########|..|########|..|########|..|#######/...# | |
#..............................................................# | |
################################################################ | |
# Stage Two - Build Python # | |
################################################################ | |
build: | |
needs: | |
- initialize | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md | |
- macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md | |
- macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md | |
- windows-2019 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
cibuildwheel: | |
- "cp38" | |
- "cp39" | |
- "cp310" | |
- "cp311" | |
- "cp312" | |
is-full-run: | |
- ${{ needs.initialize.outputs.FULL_RUN == 'true' }} | |
exclude: | |
############################ | |
# Things to always exclude # | |
############################ | |
# Skip when cibuildwheel != python version | |
# to avoid duplication | |
- python-version: "3.8" | |
cibuildwheel: "cp39" | |
- python-version: "3.8" | |
cibuildwheel: "cp310" | |
- python-version: "3.8" | |
cibuildwheel: "cp311" | |
- python-version: "3.8" | |
cibuildwheel: "cp312" | |
- python-version: "3.9" | |
cibuildwheel: "cp38" | |
- python-version: "3.9" | |
cibuildwheel: "cp310" | |
- python-version: "3.9" | |
cibuildwheel: "cp311" | |
- python-version: "3.9" | |
cibuildwheel: "cp312" | |
- python-version: "3.10" | |
cibuildwheel: "cp38" | |
- python-version: "3.10" | |
cibuildwheel: "cp39" | |
- python-version: "3.10" | |
cibuildwheel: "cp311" | |
- python-version: "3.10" | |
cibuildwheel: "cp312" | |
- python-version: "3.11" | |
cibuildwheel: "cp38" | |
- python-version: "3.11" | |
cibuildwheel: "cp39" | |
- python-version: "3.11" | |
cibuildwheel: "cp310" | |
- python-version: "3.11" | |
cibuildwheel: "cp312" | |
- python-version: "3.12" | |
cibuildwheel: "cp38" | |
- python-version: "3.12" | |
cibuildwheel: "cp39" | |
- python-version: "3.12" | |
cibuildwheel: "cp310" | |
- python-version: "3.12" | |
cibuildwheel: "cp311" | |
############################################## | |
# Things to exclude if not a full matrix run # | |
############################################## | |
# mac arm builds support py3.10+ | |
- os: macos-14 | |
python-version: "3.8" | |
- os: macos-14 | |
python-version: "3.9" | |
# Avoid extra resources for windows build | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.8" | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.9" | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.10" | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.11" | |
# avoid unnecessary use of mac resources | |
- is-full-run: false | |
os: macos-12 | |
- is-full-run: false | |
os: macos-14 | |
python-version: "3.8" | |
- is-full-run: false | |
os: macos-14 | |
python-version: "3.9" | |
- is-full-run: false | |
os: macos-14 | |
python-version: "3.10" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Set up Caches | |
uses: ./.github/actions/setup-caches | |
- name: Set up dependencies | |
uses: ./.github/actions/setup-dependencies | |
with: | |
cibuildwheel: '${{ matrix.cibuildwheel }}' | |
if: ${{ runner.os != 'Linux' }} | |
######## | |
# Linux | |
- name: Python Wheel Steps (Linux - cibuildwheel) | |
run: make dist-py-cibw | |
env: | |
CIBW_BUILD: "${{ matrix.cibuildwheel }}-manylinux*" | |
CIBW_ENVIRONMENT_LINUX: CSP_MANYLINUX="ON" CCACHE_DIR="/host/home/runner/work/csp/csp/.ccache" VCPKG_DEFAULT_BINARY_CACHE="/host${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" VCPKG_DOWNLOADS="/host${{ env.VCPKG_DOWNLOADS }}" | |
CIBW_BUILD_VERBOSITY: 3 | |
if: ${{ runner.os == 'Linux' }} | |
######## | |
# Macos | |
- name: Python Build Steps (Macos x86) | |
run: make dist-py-cibw | |
env: | |
CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*" | |
CIBW_ENVIRONMENT_MACOS: CCACHE_DIR="/Users/runner/work/csp/csp/.ccache" VCPKG_DEFAULT_BINARY_CACHE="${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" VCPKG_DOWNLOADS="${{ env.VCPKG_DOWNLOADS }}" | |
CIBW_ARCHS_MACOS: x86_64 | |
CIBW_BUILD_VERBOSITY: 3 | |
if: ${{ matrix.os == 'macos-12' }} | |
- name: Python Build Steps (Macos arm) | |
run: make dist-py-cibw | |
env: | |
CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*" | |
CIBW_ENVIRONMENT_MACOS: CCACHE_DIR="/Users/runner/work/csp/csp/.ccache" VCPKG_DEFAULT_BINARY_CACHE="${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" VCPKG_DOWNLOADS="${{ env.VCPKG_DOWNLOADS }}" | |
CIBW_ARCHS_MACOS: arm64 | |
CIBW_BUILD_VERBOSITY: 3 | |
if: ${{ matrix.os == 'macos-14' }} | |
########## | |
# Windows | |
- name: Python Build Steps (Windows 2019) | |
run: make dist-py-cibw | |
env: | |
CIBW_BUILD: "${{ matrix.cibuildwheel }}-win_amd64" | |
CSP_GENERATOR: "Visual Studio 16 2019" | |
VCPKG_DEFAULT_BINARY_CACHE: C:\\Users\\runneradmin\\AppData\\Local\\vcpkg_cache | |
VCPKG_DOWNLOADS: C:\\Users\\runneradmin\\AppData\\Local\\vcpkg_download_cache | |
if: ${{ matrix.os == 'windows-2019' }} | |
########## | |
# Common | |
- name: Check Wheels | |
run: make dist-check | |
- name: Upload Wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: csp-dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} | |
path: dist/*.whl | |
################################################################ | |
#..............................................................# | |
#..|########\..|##|..|##|..|########|..|##|........|#######\...# | |
#..|##|../##/..|##|..|##|.....|##|.....|##|........|##|..\##\..# | |
#..|##|./##/...|##|..|##|.....|##|.....|##|........|##|..|##|..# | |
#..|##||#<.....|##|..|##|.....|##|.....|##|........|##|..|##|..# | |
#..|##|.\##\...|##|..|##|.....|##|.....|##|........|##|..|##|..# | |
#..|##|..\##\..|##|..|##|.....|##|.....|########|..|##|../##/..# | |
#..|########/..|########|..|########|..|########|..|#######/...# | |
#..............................................................# | |
#..../####\....|#######\...|########|..../####\....|########|..# | |
#../##/..\##\..|##|..\##\.....|##|...../##/..\##\..|########|..# | |
#...\##\.......|##|..|##|.....|##|......\##\..........|##|.....# | |
#.....\##\.....|##|..|##|.....|##|........\##\........|##|.....# | |
#.......\##\...|##|..|##|.....|##|..........\##\......|##|.....# | |
#..\##\./##/...|##|../##/.....|##|.....\##\./##/......|##|.....# | |
#...\####/.....|#######/...|########|...\####/........|##|.....# | |
#..............................................................# | |
################################################################ | |
# Stage Three - Build SDist # | |
################################################################ | |
build_sdist: | |
needs: | |
- initialize | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 | |
python-version: | |
- 3.9 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Install python dependencies | |
run: make requirements | |
- name: Python SDist Steps | |
run: make dist-py-sdist | |
- name: Check sdist | |
run: make dist-check | |
- name: Upload SDist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: csp-sdist | |
path: dist/*.tar.gz | |
#################################################### | |
#..................................................# | |
#..|########|..|########|..../####\....|########|..# | |
#..|########|..|##|......../##/..\##\..|########|..# | |
#.....|##|.....|##|.........\##\..........|##|.....# | |
#.....|##|.....|########|.....\##\........|##|.....# | |
#.....|##|.....|##|.............\##\......|##|.....# | |
#.....|##|.....|##|........\##\../##/.....|##|.....# | |
#.....|##|.....|########|...\####/........|##|.....# | |
#..................................................# | |
#################################################### | |
# Stage Four - Test Python # | |
#################################################### | |
test: | |
needs: | |
- initialize | |
- build | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 | |
- macos-12 | |
- macos-14 | |
- windows-2019 | |
python-version: | |
- 3.8 | |
- 3.9 | |
- "3.10" | |
- 3.11 | |
- 3.12 | |
is-full-run: | |
- ${{ needs.initialize.outputs.FULL_RUN == 'true' }} | |
exclude: | |
############################################## | |
# Things to exclude if not a full matrix run # | |
############################################## | |
# mac arm builds support py3.10+ | |
- os: macos-14 | |
python-version: "3.8" | |
- os: macos-14 | |
python-version: "3.9" | |
# Avoid extra resources for windows build | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.8" | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.9" | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.10" | |
- is-full-run: false | |
os: windows-2019 | |
python-version: "3.11" | |
# avoid unnecessary use of mac resources | |
- is-full-run: false | |
os: macos-12 | |
- is-full-run: false | |
os: macos-14 | |
python-version: "3.8" | |
- is-full-run: false | |
os: macos-14 | |
python-version: "3.9" | |
- is-full-run: false | |
os: macos-14 | |
python-version: "3.10" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Install python dependencies | |
run: make requirements | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
name: csp-dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} | |
######## | |
# Linux | |
- name: Install test dependencies (Linux) | |
shell: bash | |
run: sudo apt-get install graphviz | |
if: ${{ runner.os == 'Linux' }} | |
- name: Install wheel (Linux) | |
run: | | |
python -m pip install -U *manylinux*.whl | |
python -m pip install -U --no-deps *manylinux*.whl --target . | |
if: ${{ runner.os == 'Linux' }} | |
######## | |
# Macos | |
- name: Install test dependencies (Mac) | |
shell: bash | |
run: brew install graphviz | |
if: ${{ runner.os == 'macOS' }} | |
- name: Install wheel (OSX x86) | |
run: | | |
python -m pip install -U *x86*.whl | |
python -m pip install -U --no-deps *x86*.whl --target . | |
if: ${{ runner.os == 'macOS' && runner.arch == 'X64' }} | |
- name: Install wheel (OSX arm) | |
run: | | |
python -m pip install -U *arm64*.whl | |
python -m pip install -U --no-deps *arm64*.whl --target . | |
if: ${{ runner.os == 'macOS' && runner.arch == 'ARM64' }} | |
######## | |
# Windows | |
- name: Install test dependencies (Windows) | |
run: choco install graphviz --no-progress -y | |
if: ${{ runner.os == 'Windows' }} | |
- name: Install wheel (windows) | |
run: | | |
python -m pip install -U (Get-ChildItem .\*.whl | Select-Object -Expand FullName) | |
python -m pip install -U --no-deps (Get-ChildItem .\*.whl | Select-Object -Expand FullName) --target . | |
if: ${{ runner.os == 'Windows' }} | |
########## | |
# Common | |
- name: Python Test Steps | |
run: make test | |
################################################################ | |
#..............................................................# | |
#..|########|..|########|..../####\....|########|..............# | |
#..|########|..|##|......../##/..\##\..|########|..............# | |
#.....|##|.....|##|.........\##\..........|##|.................# | |
#.....|##|.....|########|.....\##\........|##|.................# | |
#.....|##|.....|##|.............\##\......|##|.................# | |
#.....|##|.....|##|........\##\../##/.....|##|.................# | |
#.....|##|.....|########|...\####/........|##|.................# | |
#..............................................................# | |
#..../####\....|#######\...|########|..../####\....|########|..# | |
#../##/..\##\..|##|..\##\.....|##|...../##/..\##\..|########|..# | |
#...\##\.......|##|..|##|.....|##|......\##\..........|##|.....# | |
#.....\##\.....|##|..|##|.....|##|........\##\........|##|.....# | |
#.......\##\...|##|..|##|.....|##|..........\##\......|##|.....# | |
#..\##\./##/...|##|../##/.....|##|.....\##\./##/......|##|.....# | |
#...\####/.....|#######/...|########|...\####/........|##|.....# | |
#..............................................................# | |
################################################################ | |
# Stage Four - Build / test the SDist # | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# | |
test_sdist: | |
needs: | |
- initialize | |
- build_sdist | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 | |
python-version: | |
- 3.9 | |
runs-on: ${{ matrix.os }} | |
if: ${{ needs.initialize.outputs.FULL_RUN == 'true' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Set up Caches | |
uses: ./.github/actions/setup-caches | |
- name: Install python dependencies | |
run: make requirements | |
- uses: actions/download-artifact@v4 | |
with: | |
name: csp-sdist | |
path: dist/ | |
- name: Install sdist | |
run: | | |
python -m pip install -U -vvv dist/csp*.tar.gz | |
python -m pip install -U --no-deps -vvv dist/csp*.tar.gz --target . | |
env: | |
CCACHE_DIR: /home/runner/work/csp/csp/.ccache | |
VCPKG_DEFAULT_BINARY_CACHE: /home/runner/vcpkg_cache | |
VCPKG_DOWNLOADS: /home/runner/vcpkg_download_cache | |
- name: Run tests against from-scratch sdist build | |
run: make test | |
env: | |
CSP_TEST_SKIP_EXAMPLES: "1" | |
#################################################### | |
#..................................................# | |
#..|########|..|########|..../####\....|########|..# | |
#..|########|..|##|......../##/..\##\..|########|..# | |
#.....|##|.....|##|.........\##\..........|##|.....# | |
#.....|##|.....|########|.....\##\........|##|.....# | |
#.....|##|.....|##|.............\##\......|##|.....# | |
#.....|##|.....|##|........\##\../##/.....|##|.....# | |
#.....|##|.....|########|...\####/........|##|.....# | |
#..................................................# | |
#..|#######\...|########|..|########\..../####\....# | |
#..|##|..\##\..|##|........|##|../##/../##/..\##\..# | |
#..|##|..|##|..|##|........|##|./##/....\##\.......# | |
#..|##|..|##|..|########|..|##||##/.......\##\.....# | |
#..|##|..|##|..|##|........|##|.............\##\...# | |
#..|##|../##/..|##|........|##|........\##\../##/..# | |
#..|#######/...|########|..|##|.........\####/.....# | |
#..................................................# | |
#################################################### | |
# Test Dependencies/Regressions # | |
#################################################### | |
test_dependencies: | |
needs: | |
- initialize | |
- build | |
strategy: | |
matrix: | |
os: | |
- ubuntu-20.04 | |
python-version: | |
- 3.9 | |
package: | |
- "sqlalchemy>=2" | |
- "sqlalchemy<2" | |
- "numpy==1.19.5" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Install python dependencies | |
run: make requirements | |
- name: Install test dependencies | |
shell: bash | |
run: sudo apt-get install graphviz | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
name: csp-dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} | |
- name: Install wheel | |
run: | | |
python -m pip install -U *manylinux*.whl | |
python -m pip install -U --no-deps *manylinux*.whl --target . | |
- name: Install package - ${{ matrix.package }} | |
run: python -m pip install -U "${{ matrix.package }}" | |
- name: Python Test Steps | |
run: make test TEST_ARGS="-k TestDBReader" | |
if: ${{ contains( 'sqlalchemy', matrix.package )}} | |
- name: Python Test Steps | |
run: make test | |
if: ${{ contains( 'numpy', matrix.package )}} | |
########################################################################################################### | |
#.........................................................................................................# | |
#..|########|..|########|..../####\....|########|.........................................................# | |
#..|########|..|##|......../##/..\##\..|########|.........................................................# | |
#.....|##|.....|##|.........\##\..........|##|............................................................# | |
#.....|##|.....|########|.....\##\........|##|............................................................# | |
#.....|##|.....|##|.............\##\......|##|............................................................# | |
#.....|##|.....|##|........\##\../##/.....|##|............................................................# | |
#.....|##|.....|########|...\####/........|##|............................................................# | |
#.........................................................................................................# | |
#...../#####\.....|#######\....../#####\.....|########\..|########|..|########|..|########\...../####\....# | |
#..../##/.\##\....|##|..\##\..../##/.\##\....|##|../##/..|########|..|##|........|##|../##/.../##/..\##\..# | |
#.../##/...\##\...|##|..|##|.../##/...\##\...|##|./##/......|##|.....|##|........|##|./##/.....\##\.......# | |
#../###########\..|##|..|##|../###########\..|##||##/.......|##|.....|########|..|##||##<........\##\.....# | |
#..|##|.....|##|..|##|..|##|..|##|.....|##|..|##|...........|##|.....|##|........|##|.\##\.........\##\...# | |
#..|##|.....|##|..|##|../##/..|##|.....|##|..|##|...........|##|.....|##|........|##|..\##\...\##\../##/..# | |
#..|##|.....|##|..|#######/...|##|.....|##|..|##|...........|##|.....|########|..|##|...\##\...\####/.....# | |
#.........................................................................................................# | |
########################################################################################################### | |
# Test Service Adapters # | |
########################################################################################################### | |
test_adapters: | |
needs: | |
- initialize | |
- build | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 | |
python-version: | |
- 3.11 | |
adapter: | |
- kafka | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
version: '${{ matrix.python-version }}' | |
- name: Install python dependencies | |
run: make requirements | |
- name: Install test dependencies | |
shell: bash | |
run: sudo apt-get install graphviz | |
# Download artifact | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
name: csp-dist-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} | |
- name: Install wheel | |
run: python -m pip install -U *manylinux*.whl --target . | |
- name: Spin up adapter service | |
run: make dockerup ADAPTER=${{ matrix.adapter }} DOCKERARGS="--wait --wait-timeout 30" | |
- name: Wait a few seconds after docker images have been spun up | |
run: sleep 30 | |
# Run tests | |
- name: Setup test flags | |
shell: bash | |
run: echo "CSP_TEST_$( echo ${{ matrix.adapter }} | awk '{print toupper($0)}' )=1" >> $GITHUB_ENV | |
- name: Python Test Steps | |
run: make test-py TEST_ARGS="-k ${{ matrix.adapter }}" | |
- name: Spin down adapter service | |
run: make dockerdown ADAPTER=${{ matrix.adapter }} | |
if: ${{ always() }} | |
############################################################################################ | |
#..........................................................................................# | |
#..|########\...|########|..|##|........|########|...../#####\......./####\....|########|..# | |
#..|##|../##/...|##|........|##|........|##|........../##/.\##\..../##/..\##\..|##|........# | |
#..|##|./##/....|##|........|##|........|##|........./##/...\##\....\##\.......|##|........# | |
#..|##||##<.....|########|..|##|........|########|../###########\.....\##\.....|########|..# | |
#..|##|.\##\....|##|........|##|........|##|........|##|.....|##|.......\##\...|##|........# | |
#..|##|..\##\...|##|........|########|..|##|........|##|.....|##|..\##\./##/...|##|........# | |
#..|##|...\##\..|########|..|########|..|########|..|##|.....|##|...\####/.....|########|..# | |
#..........................................................................................# | |
############################################################################################ | |
# Upload Release Artifacts # | |
############################################################################################ | |
# only publish artifacts on tags, but otherwise this always runs | |
# Note this whole workflow only triggers on release tags (e.g. "v0.1.0") | |
publish_release_artifacts: | |
# build must complete and all tests must pass | |
# before release artifacts can be uploaded | |
needs: | |
- build_sdist | |
- build | |
- test | |
- test_sdist | |
- test_dependencies | |
- test_adapters | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Download wheels and sdist | |
uses: actions/download-artifact@v4 | |
with: | |
name: | |
merge-multiple: true | |
path: ./dist | |
- name: Display structure of downloaded files | |
run: ls -R ./dist | |
- name: Publish to github releases | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
generate_release_notes: true | |
files: dist/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |