Skip to content

Commit

Permalink
feat: Split validations to required (stopping release) and optional (…
Browse files Browse the repository at this point in the history
…not stopping the release) (#101)
  • Loading branch information
andreaangiolillo authored Jul 23, 2024
1 parent 255dbb2 commit 84b73d9
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions .github/workflows/release-spec-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
permissions:
contents: write
jobs:
run-validations:
# Required validations will stop the release if they fail
run-required-validations:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -15,12 +16,14 @@ jobs:
env:
SPECTRAL_VERSION: ${{ vars.SPECTRAL_VERSION }}
run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ./tools/cli/test/data/openapi-foas*.{yml,yaml} --ruleset=.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186
- name: Validate the FOAS can be used to generate Postman collection
run: |
cp -rf "./tools/cli/test/data/openapi-foas-dev.json" "./tools/postman/openapi/atlas-api.json"
pushd tools/postman
make convert_to_collection
popd
- name: Create Issue
if: ${{ failure() }}
uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd
with:
labels: failed-release
title: "(PROD) Required Spectral validation failed :scream_cat:"
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
token: ${{ secrets.API_BOT_PAT }}
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
Expand All @@ -36,4 +39,33 @@ jobs:
cp -rf "./tools/cli/test/data/openapi-foas-dev.yaml" "atlas-sdk-go/openapi/atlas-sdk.yaml"
pushd atlas-sdk-go
make -e openapi-pipeline
popd
- name: Create Issue
if: ${{ failure() }}
uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd
with:
labels: failed-release
title: "(PROD) Required GO SDK validation failed :scream_cat:"
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
token: ${{ secrets.API_BOT_PAT }}

# Optional validations won't stop the release but only open a GH issue if they fail
run-optional-validations:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Validate the FOAS can be used to generate Postman collection
run: |
cp -rf "./tools/cli/test/data/openapi-foas-dev.json" "./tools/postman/openapi/atlas-api.json"
pushd tools/postman
make convert_to_collection
popd
- name: Create Issue
if: ${{ failure() }}
uses: imjohnbo/issue-bot@572eed14422c4d6ca37e870f97e7da209422f5bd
with:
labels: failed-release
title: "(PROD) Optional Postman validation failed :scream_cat:"
body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
token: ${{ secrets.API_BOT_PAT }}

0 comments on commit 84b73d9

Please sign in to comment.