Repository navigation
145 lines (138 loc) · 4.83 KB
/
Copy pathci-testing-pull-request.yml
File metadata and controls
145 lines (138 loc) · 4.83 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# 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: checkout source branch
uses: actions/checkout@v7.0.1
- name: Setup environment
uses: ./.github/actions/setup-simcore-env
with:
setup-docker: 'false'
expose-github-runtime: 'false'
- 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-openai-compatible:
needs: api-specs
timeout-minutes: 10
name: "api-server openai compatibility"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7.0.1
- name: check for api-server changes
uses: dorny/paths-filter@v4
id: changes
with:
filters: |
api-server:
- 'services/api-server/**'
- name: Setup environment
if: steps.changes.outputs.api-server == 'true'
uses: ./.github/actions/setup-simcore-env
with:
setup-docker: 'false'
expose-github-runtime: 'false'
- name: Generate openapi specs
if: steps.changes.outputs.api-server == 'true'
run: |
make devenv
source .venv/bin/activate
cd services/api-server
make install-dev
make openapi-openai-compatible.json
- name: check api-server openai compatibility
if: steps.changes.outputs.api-server == 'true'
run: |
source .venv/bin/activate
cd services/api-server
make test-openai-api-compatibility
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@v7.0.0
with:
python-version: "3.13"
- name: checkout
uses: actions/checkout@v7.0.1
- 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@v7.0.0
with:
python-version: "3.13"
- name: checkout
uses: actions/checkout@v7.0.1
- 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" \
.