Skip to content

Commit

Permalink
chore: remove OpenApi check in CI (#3314)
Browse files Browse the repository at this point in the history
* chore: remove OpenApi check in CI

* remove pullrequest trigger
  • Loading branch information
paullatzelsperger authored Jul 19, 2023
1 parent b62b87f commit f4a7d5c
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 3,793 deletions.
53 changes: 3 additions & 50 deletions .github/workflows/apidoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,16 @@ on:
type: string

push:
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- 'docs/**'
- 'CODEOWNERS'
- 'LICENSE'

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

jobs:
Verify-OpenAPI-Definitions:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
apiGroup: [ 'management-api', 'control-api' ]
env:
rootDir: resources/openapi/yaml/${{ matrix.apiGroup }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-build

- name: Save previous OpenAPI definition
run: |
mkdir -p git-sorted/${{ matrix.apiGroup }}
files=($(ls $rootDir))
for file in ${files[@]}; do
yq -P 'sort_keys(..)' $rootDir/$file > git-sorted/${{ matrix.apiGroup }}/$file
done
- name: Generate OpenAPI definitions from code
run: |
export
./gradlew resolve
# Can be used (and yq tasks removed) when https://github.com/kpramesh2212/openapi-merger-plugin/pull/11/files is merged
#- name: Check OpenAPI definitions match code
# run: git diff --exit-code

- name: Check OpenAPI definitions match code
run: |
mkdir -p git-regen/${{ matrix.apiGroup }}
files=($(ls resources/openapi/yaml/${{ matrix.apiGroup}}))
for file in ${files[@]}; do
yq -P 'sort_keys(..)' $rootDir/$file > git-regen/${{ matrix.apiGroup }}/$file
done
diff -r git-sorted git-regen
Publish-To-SwaggerHub:
# do NOT run on forks or on PRs. The Org ("edc") is unique all across SwaggerHub
if: github.repository == 'eclipse-edc/Connector' && github.event_name != 'pull_request'
# do NOT run on forks. The Org ("edc") is unique all across SwaggerHub
if: github.repository == 'eclipse-edc/Connector'
runs-on: ubuntu-latest
needs: [ Verify-OpenAPI-Definitions ]
strategy:
matrix:
apiGroup: [ 'management-api', 'control-api' ]
Expand All @@ -88,6 +40,7 @@ jobs:
if [ ! -z $VERSION ]; then
cmd="-Pversion=$VERSION"
fi
./gradlew resolve
./gradlew ${cmd} -PapiTitle="${{ matrix.apiGroup }}" -PapiDescription="REST API documentation for the ${{ matrix.apiGroup }}" :mergeApiSpec --input=${{ env.rootDir }} --output=${{ matrix.apiGroup }}.yaml
# install swaggerhub CLI
Expand Down
82 changes: 0 additions & 82 deletions resources/openapi/yaml/control-api/control-plane-api.yaml

This file was deleted.

157 changes: 0 additions & 157 deletions resources/openapi/yaml/control-api/data-plane-api.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions resources/openapi/yaml/control-api/transfer-data-plane.yaml

This file was deleted.

Loading

0 comments on commit f4a7d5c

Please sign in to comment.