👷 add job to update open-api-framework #1
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: open-api-workflow oaf-check | ||
on: | ||
workflow_call: | ||
inputs: | ||
python-version: | ||
type: string | ||
required: true | ||
jobs: | ||
oaf-up-to-date: | ||
name: Check for new OAF version | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: 'requirements/dev.txt' | ||
- name: Install dependencies | ||
run: pip install $(grep "pip-tools==" requirements/dev.txt) | ||
- name: Run compile dependencies | ||
run: ./bin/compile_dependencies.sh --upgrade-package open-api-framework | ||
- name: Check git diff | ||
run: git diff --exit-code -- requirements/*.txt | ||
create-oaf-update-pr: | ||
name: Create a pull requests to update OAF | ||
runs-on: ubuntu-latest | ||
needs: [oaf-up-to-date] | ||
if: needs.oaf-up-to-date.result == 'failed' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: 'requirements/dev.txt' | ||
- name: Install dependencies | ||
run: pip install $(grep "pip-tools==" requirements/dev.txt) | ||
- name: Run compile dependencies | ||
run: ./bin/compile_dependencies.sh --upgrade-package open-api-framework | ||
- name: Get OAF Version | ||
run: $oaf_version=$(grep -Po '(?<=pip-tools==)[^\n]*' requirements/dev.txt) | ||
- name: Create Branch | ||
run: git branch update/open-api-framework-$oaf_version | ||
- name: Commit Changes | ||
run: git commit -f requires/*.txt -m ':arrow_up: Update oaf to $oaf_version' | ||
- name: log | ||
run: git log |