Skip to content

Migrate Python Codebase from 3.9 to 3.10 #1

Migrate Python Codebase from 3.9 to 3.10

Migrate Python Codebase from 3.9 to 3.10 #1

# This workflow holds jobs which are required to pass before merging into master
name: PR CI
on:
pull_request:
branches:
- "*"
# https://github.blog/changelog/2023-02-08-pull-request-merge-queue-public-beta/
merge_group:
branches:
- "master"
workflow_dispatch:
inputs:
target_repo:
description: full repository name (e.g. 'ITISFoundation/osparc-simcore')
required: true
default: "ITISFoundation/osparc-simcore"
type: environment
target_branch:
description: Check backwards compatibility against target_branch in target_repo
required: true
default: "master"
type: environment
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
api-specs:
timeout-minutes: 10
name: "check OAS' are up to date"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.6.x"
enable-cache: false
- name: checkout source branch
uses: actions/checkout@v4
- name: Generate openapi specs
run: |
make devenv
source .venv/bin/activate
make openapi-specs
- name: Check openapi specs are up to date
run: |
if ! ./ci/github/helpers/openapi-specs-diff.bash diff \
"https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA" \
.; then \
echo "::error:: OAS are not up to date. Run 'make openapi-specs' to update them"; exit 1; \
fi
api-server-oas-breaking:
needs: api-specs
timeout-minutes: 10
name: "api-server backwards compatibility"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: checkout
uses: actions/checkout@v4
- name: Set environment variables based on event type
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "REPO=${{ inputs.target_repo }}" >> $GITHUB_ENV
echo "BRANCH=${{ inputs.target_branch }}" >> $GITHUB_ENV
else
echo "REPO=${{ github.event.pull_request.base.repo.full_name }}" >> $GITHUB_ENV
echo "BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
fi
- name: check api-server backwards compatibility
run: |
./scripts/openapi-diff.bash breaking --fail-on ERR\
"https://raw.githubusercontent.com/$REPO/refs/heads/$BRANCH/services/api-server/openapi.json" \
/specs/services/api-server/openapi.json
all-oas-breaking:
needs: api-specs
continue-on-error: true
timeout-minutes: 10
name: "OAS backwards compatibility"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: checkout
uses: actions/checkout@v4
- name: Set environment variables based on event type
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "REPO=${{ inputs.target_repo }}" >> $GITHUB_ENV
echo "BRANCH=${{ inputs.target_branch }}" >> $GITHUB_ENV
else
echo "REPO=${{ github.event.pull_request.base.repo.full_name }}" >> $GITHUB_ENV
echo "BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
fi
- name: Check openapi-specs backwards compatibility
run: |
./ci/github/helpers/openapi-specs-diff.bash breaking \
"https://raw.githubusercontent.com/$REPO/refs/heads/$BRANCH" \
.