-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.73 KB
/
oaf-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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