From aacba6cf9f7e628f9d40693684b2e7a82d6d9757 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Wed, 8 Mar 2023 13:56:03 +0100 Subject: [PATCH 1/3] fix: wrong link to user guide --- api-editor/gui/src/features/externalLinks/urlBuilder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-editor/gui/src/features/externalLinks/urlBuilder.ts b/api-editor/gui/src/features/externalLinks/urlBuilder.ts index a6723b0d5..f9e9c7eb3 100644 --- a/api-editor/gui/src/features/externalLinks/urlBuilder.ts +++ b/api-editor/gui/src/features/externalLinks/urlBuilder.ts @@ -5,9 +5,9 @@ const baseURL = 'https://github.com/lars-reimann/api-editor'; // Documentation -const documentationBaseURL = `${baseURL}/blob/main/docs`; +const documentationBaseURL = `https://api-editor.readthedocs.io/en/latest`; -export const userGuideURL = `${documentationBaseURL}/api-editor.md`; +export const userGuideURL = `${documentationBaseURL}/gui`; // Issues From 9eb97c986b5d3961c905391405824d7b1f57452b Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Wed, 8 Mar 2023 16:20:26 +0100 Subject: [PATCH 2/3] docs: configure codecov --- .github/workflows/main.yml | 63 ++++++++++++++++++++++++++++++++++++-- .github/workflows/pr.yml | 31 ++++++++++--------- codecov.yml | 26 ++++++++++++++++ 3 files changed, 104 insertions(+), 16 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7566a2691..01b97d7fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,9 +40,25 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Build with Gradle - run: ./gradlew build + run: ./gradlew build koverMergedXmlReport working-directory: ./api-editor + - name: Upload test report + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: backend test report + path: api-editor/backend/build/reports + if-no-files-found: ignore + + - name: Upload coverage to Codecov + if: ${{ github.actor != 'dependabot[bot]' }} + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: api-editor/backend/build/reports/kover/merged/xml + files: report.xml + - name: Install dependencies run: npm ci @@ -51,6 +67,40 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + gui-test-coverage: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./api-editor/gui + + strategy: + matrix: + node-version: [ 18.x ] + + steps: + - name: Checkout source + uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: api-editor/gui/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Test with Jest + run: npm run test-with-coverage + + - name: Upload coverage to Codecov + if: ${{ github.actor != 'dependabot[bot]' }} + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: package-parser + files: coverage.xml build-package-parser: runs-on: ubuntu-latest @@ -104,5 +154,14 @@ jobs: - name: Smoke test (migration) run: poetry run parse-package migrate -a1 tests/data/migration/apiv1_data.json -a2 tests/data/migration/apiv2_data.json -a tests/data/migration/annotationv1.json -o out + # Requires installation of pytest and pytest-cov - name: Test with pytest - run: poetry run pytest --doctest-modules + run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=xml + + - name: Upload coverage to Codecov + if: ${{ github.actor != 'dependabot[bot]' }} + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: package-parser + files: coverage.xml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 092c8f0df..9beaaecfa 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -43,7 +43,7 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Build with Gradle - run: ./gradlew build backend:koverHtmlReport + run: ./gradlew build koverMergedXmlReport - name: Upload test report if: ${{ failure() }} @@ -53,12 +53,13 @@ jobs: path: api-editor/backend/build/reports if-no-files-found: ignore - - name: Upload test coverage + - name: Upload coverage to Codecov if: ${{ github.actor != 'dependabot[bot]' }} - uses: actions/upload-artifact@v3 + uses: codecov/codecov-action@v3 with: - name: backend test coverage - path: api-editor/backend/build/reports/kover/html/ + token: ${{ secrets.CODECOV_TOKEN }} + directory: api-editor/backend/build/reports/kover/merged/xml + files: report.xml gui-test-coverage: runs-on: ubuntu-latest @@ -87,12 +88,13 @@ jobs: - name: Test with Jest run: npm run test-with-coverage - - name: Upload test report + - name: Upload coverage to Codecov if: ${{ github.actor != 'dependabot[bot]' }} - uses: actions/upload-artifact@v3 + uses: codecov/codecov-action@v3 with: - name: gui test coverage - path: api-editor/gui/coverage/lcov-report + token: ${{ secrets.CODECOV_TOKEN }} + directory: package-parser + files: coverage.xml build-package-parser: runs-on: ubuntu-latest @@ -145,11 +147,12 @@ jobs: # Requires installation of pytest and pytest-cov - name: Test with pytest - run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=html + run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=xml - - name: Upload test coverage + - name: Upload coverage to Codecov if: ${{ github.actor != 'dependabot[bot]' }} - uses: actions/upload-artifact@v3 + uses: codecov/codecov-action@v3 with: - name: package-parser test coverage - path: package-parser/htmlcov + token: ${{ secrets.CODECOV_TOKEN }} + directory: package-parser + files: coverage.xml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..3295252f2 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,26 @@ +codecov: + notify: + after_n_builds: 3 + +comment: + after_n_builds: 3 + layout: 'header, diff, flags, components, files' + +component_management: + individual_components: + - component_id: module_backend + name: backend + paths: + - api-editor/backend/** + - component_id: module_desktop + name: desktop + paths: + - api-editor/desktop/** + - component_id: module_gui + name: gui + paths: + - api-editor/gui/** + - component_id: module_package-parser + name: package-parser + paths: + - package-parser/** From 3ed0a82a1d7c7a99c860bdd1da12eb7ef2a6ad46 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Wed, 8 Mar 2023 16:34:23 +0100 Subject: [PATCH 3/3] ci: fix paths --- .github/workflows/main.yml | 6 +++--- .github/workflows/pr.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01b97d7fd..db482883a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: api-editor/backend/build/reports/kover/merged/xml + directory: api-editor/build/reports/kover/merged/xml files: report.xml - name: Install dependencies @@ -99,8 +99,8 @@ jobs: uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: package-parser - files: coverage.xml + directory: api-editor/gui/coverage + files: clover.xml build-package-parser: runs-on: ubuntu-latest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9beaaecfa..218acdada 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -58,7 +58,7 @@ jobs: uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: api-editor/backend/build/reports/kover/merged/xml + directory: api-editor/build/reports/kover/merged/xml files: report.xml gui-test-coverage: @@ -93,8 +93,8 @@ jobs: uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: package-parser - files: coverage.xml + directory: api-editor/gui/coverage + files: clover.xml build-package-parser: runs-on: ubuntu-latest