diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5c0ba30..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2.1 - -orbs: - codecov: codecov/codecov@1.2.5 - -jobs: - build: - docker: - - image: cimg/node:18.20.4 - steps: - - checkout - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - - v1-dependencies- - - run: - name: Build - command: npm install - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - run: - name: Test - command: npm test - - store_test_results: - path: test/results - - store_artifacts: - path: test/results - - codecov/upload \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 41563a0..0a6f724 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -42,5 +42,5 @@ - [ ] I have updated the documentation accordingly. - [ ] I have read the **CONTRIBUTING** document. - [ ] I have added tests to cover my changes and the overall coverage did not decrease. -- [ ] All unit tests pass on CircleCi. +- [ ] All unit tests pass in GitHub Actions. - [ ] I ran all tests locally and they pass. diff --git a/.circleci/codecov.yml b/.github/codecov.yml similarity index 92% rename from .circleci/codecov.yml rename to .github/codecov.yml index fa0f576..0e1e8e7 100644 --- a/.circleci/codecov.yml +++ b/.github/codecov.yml @@ -11,4 +11,4 @@ coverage: enabled: true target: 80% threshold: null - base: auto \ No newline at end of file + base: auto diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index cddac16..cbbd1af 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -23,14 +23,14 @@ jobs: - name: npm install run: npm i - name: Setup CLI - uses: adobe/aio-cli-setup-action@1.1.0 + uses: adobe/aio-cli-setup-action@1.3.0 with: os: ${{ matrix.os }} version: 8.x.x - name: Build env: AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }} - uses: adobe/aio-apps-action@2.0.1 + uses: adobe/aio-apps-action@4.1.0 with: os: ${{ matrix.os }} command: build @@ -44,7 +44,7 @@ jobs: AIO_PROJECT_WORKSPACE_ID: ${{ secrets.AIO_PROJECT_WORKSPACE_ID_PROD }} AIO_PROJECT_WORKSPACE_NAME: ${{ secrets.AIO_PROJECT_WORKSPACE_NAME_PROD }} AIO_PROJECT_WORKSPACE_DETAILS_SERVICES: ${{ secrets.AIO_PROJECT_WORKSPACE_DETAILS_SERVICES_PROD }} - uses: adobe/aio-apps-action@2.0.1 + uses: adobe/aio-apps-action@4.1.0 with: os: ${{ matrix.os }} command: deploy diff --git a/.github/workflows/deploy_stage.yml b/.github/workflows/deploy_stage.yml index 906c7ae..22bf2d5 100644 --- a/.github/workflows/deploy_stage.yml +++ b/.github/workflows/deploy_stage.yml @@ -24,14 +24,14 @@ jobs: - name: npm install run: npm i - name: Setup CLI - uses: adobe/aio-cli-setup-action@1.1.0 + uses: adobe/aio-cli-setup-action@1.3.0 with: os: ${{ matrix.os }} version: 8.x.x - name: Build env: AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_STAGE }} - uses: adobe/aio-apps-action@2.0.1 + uses: adobe/aio-apps-action@4.1.0 with: os: ${{ matrix.os }} command: build @@ -45,7 +45,7 @@ jobs: AIO_PROJECT_WORKSPACE_ID: ${{ secrets.AIO_PROJECT_WORKSPACE_ID_STAGE }} AIO_PROJECT_WORKSPACE_NAME: ${{ secrets.AIO_PROJECT_WORKSPACE_NAME_STAGE }} AIO_PROJECT_WORKSPACE_DETAILS_SERVICES: ${{ secrets.AIO_PROJECT_WORKSPACE_DETAILS_SERVICES_STAGE }} - uses: adobe/aio-apps-action@2.0.1 + uses: adobe/aio-apps-action@4.1.0 with: os: ${{ matrix.os }} command: deploy diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index a3edc2d..ea4c464 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -6,6 +6,9 @@ jobs: test: name: Test PR runs-on: ${{ matrix.os }} + permissions: + contents: read + checks: write strategy: matrix: node-version: ['18'] @@ -29,19 +32,41 @@ jobs: - name: npm install run: npm i - name: Setup CLI - uses: adobe/aio-cli-setup-action@1.1.0 + uses: adobe/aio-cli-setup-action@1.3.0 with: os: ${{ matrix.os }} version: 8.x.x - name: Build env: AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_STAGE }} - uses: adobe/aio-apps-action@2.0.1 + uses: adobe/aio-apps-action@4.1.0 with: os: ${{ matrix.os }} command: build + # Run the project's own unit suite (lint + mocha + nyc) directly. This is the + # same command CircleCI ran and is what produces the JUnit report + # (test/results/**/*.xml) and the lcov coverage report (coverage/lcov.info) that + # the reporting steps below consume. `aio app test` would not, since no `test` + # hook is defined in app.config.yaml. - name: Test - uses: adobe/aio-apps-action@2.0.1 + run: npm test + + # On a test failure only, publish a "Tests" check with the failed tests, their + # error message and stack trace (reads the Mocha JUnit report). Green runs show + # nothing. Gated to ubuntu-latest so the matrix does not publish duplicate checks. + - name: Publish test results + if: failure() && matrix.os == 'ubuntu-latest' + uses: mikepenz/action-junit-report@v5 with: - os: ${{ matrix.os }} - command: test + check_name: Tests + report_paths: 'test/results/**/*.xml' + skip_success_summary: true + fail_on_failure: false + + # Upload coverage once (from ubuntu-latest) to avoid triplicate matrix uploads. + - name: Upload coverage to Codecov + if: success() && matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v6 + with: + files: coverage/lcov.info + fail_ci_if_error: false diff --git a/README.md b/README.md index b332090..726a7ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CircleCI](https://circleci.com/gh/adobe/commerce-cif-graphql-integration-reference.svg?style=svg)](https://circleci.com/gh/adobe/commerce-cif-graphql-integration-reference) +[![AIO App CI](https://github.com/adobe/commerce-cif-graphql-integration-reference/actions/workflows/pr_test.yml/badge.svg)](https://github.com/adobe/commerce-cif-graphql-integration-reference/actions/workflows/pr_test.yml) [![codecov](https://codecov.io/gh/adobe/commerce-cif-graphql-integration-reference/branch/master/graph/badge.svg)](https://codecov.io/gh/adobe/commerce-cif-graphql-integration-reference) # 3rd-Party GraphQL integration with AEM Commerce and CIF on Adobe I/O Runtime