Skip to content

Commit

Permalink
refactor github workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis committed Dec 9, 2024
1 parent bf06671 commit 396e5b4
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 81 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2661,84 +2661,3 @@ jobs:
env:
TAG_PREFIX: hotfix-staging-github
run: ./ci/deploy/dockerhub-deploy.bash -n

system-api-specs:
needs: [changes]
if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }}
timeout-minutes: 10
name: "[sys] check api-specs are up to date"
runs-on: ubuntu-latest
steps:
- name: Ensure job passes if not PR # ensure pass so upstream jobs which depend on this will run (dockerhub deployment)
if: ${{ github.event.pull_request == null }}
run: echo "::notice Passing job because not in PR"; exit 0
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout source branch
uses: actions/checkout@v4
- name: Regenerate specs and check
run: |
uv venv .venv && source .venv/bin/activate
make openapi-specs
./ci/github/helpers/openapi-specs-diff.bash diff \
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \
.
system-backwards-compatibility:
needs: [changes, system-api-specs]
if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }}
timeout-minutes: 10
name: "[sys] api-server backwards compatibility"
runs-on: ubuntu-latest
steps:
- name: Ensure job passes if not PR # ensure pass so upstream jobs which depend on this will run (dockerhub deployment)
if: ${{ github.event.pull_request == null }}
run: echo "::notice Passing job because not in PR"; exit 0
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout
uses: actions/checkout@v4
- name: check api-server backwards compatibility
run: |
./scripts/openapi-diff.bash breaking --fail-on ERR\
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }}/services/api-server/openapi.json \
/specs/services/api-server/openapi.json
api-spec-backwards-compatibility:
needs: [changes, system-api-specs]
if: ${{ needs.changes.outputs.anything-py == 'true' && github.event_name == 'push' && github.event.pull_request != null }}
continue-on-error: true
timeout-minutes: 10
name: "api-specs-backwards-compatibility"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout
uses: actions/checkout@v4
- name: Check openapi-specs backwards compatibility
run: |
./ci/github/helpers/openapi-specs-diff.bash breaking \
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }} \
.
89 changes: 89 additions & 0 deletions .github/workflows/ci-testing-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This workflow holds jobs which are required to pass before merging into master

name: CI
on:
pull_request:
branches:
- "*"
# https://github.blog/changelog/2023-02-08-pull-request-merge-queue-public-beta/
merge_group:
branches:
- "master"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
system-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.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout source branch
uses: actions/checkout@v4
- name: Regenerate specs and check
run: |
uv venv .venv && source .venv/bin/activate
make openapi-specs
./ci/github/helpers/openapi-specs-diff.bash diff \
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \
.
api-server-backwards-compatibility:
needs: system-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.11"
- name: install uv
if: ${{ github.event.pull_request == null }}
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout
if: ${{ github.event.pull_request == null }}
uses: actions/checkout@v4
- name: check api-server backwards compatibility
run: |
./scripts/openapi-diff.bash breaking --fail-on ERR\
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }}/services/api-server/openapi.json \
/specs/services/api-server/openapi.json
oas-backwards-compatibility:
needs: system-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.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout
uses: actions/checkout@v4
- name: Check openapi-specs backwards compatibility
run: |
./ci/github/helpers/openapi-specs-diff.bash breaking \
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }} \
.

0 comments on commit 396e5b4

Please sign in to comment.