-
Notifications
You must be signed in to change notification settings - Fork 31
113 lines (107 loc) · 3.77 KB
/
ci-testing-pull-request.yml
File metadata and controls
113 lines (107 loc) · 3.77 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
# 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@v6
with:
python-version: "3.13"
- name: install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.x"
enable-cache: false
- name: checkout source branch
uses: actions/checkout@v6
- 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@v6
with:
python-version: "3.13"
- name: checkout
uses: actions/checkout@v6
- 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@v6
with:
python-version: "3.13"
- name: checkout
uses: actions/checkout@v6
- 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" \
.