feat(api-headless-cms): export more types and abstractions #10978
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file was automatically generated by github-actions-wac. | |
| # DO NOT MODIFY IT BY HAND. Instead, modify the source *.wac.ts file(s) | |
| # and run "github-actions-wac build" (or "ghawac build") to regenerate this file. | |
| # For more information, run "github-actions-wac --help". | |
| name: Pull Requests | |
| 'on': pull_request | |
| concurrency: | |
| group: pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| validateCommits: | |
| name: Validate commit messages | |
| if: github.base_ref != 'dev' | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| - uses: webiny/action-conventional-commits@v1.3.1 | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| validateCommitsDev: | |
| name: Validate commit messages (dev branch, 'feat' commits not allowed) | |
| if: github.base_ref == 'dev' | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| - uses: webiny/action-conventional-commits@v1.3.1 | |
| with: | |
| allowed-commit-types: fix,docs,style,refactor,test,build,perf,ci,chore,revert,merge,wip | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| constants: | |
| name: Create constants | |
| outputs: | |
| global-cache-key: ${{ steps.global-cache-key.outputs.global-cache-key }} | |
| run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }} | |
| is-fork-pr: ${{ steps.is-fork-pr.outputs.is-fork-pr }} | |
| changed-packages: ${{ steps.detect-changed-packages.outputs.changed-packages }} | |
| latest-webiny-version: ${{ steps.latest-webiny-version.outputs.latest-webiny-version }} | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| - name: Create global cache key | |
| id: global-cache-key | |
| run: >- | |
| echo "global-cache-key=${{ github.base_ref }}-${{ runner.os | |
| }}-$(/bin/date -u "+%m%d")-${{ vars.RANDOM_CACHE_KEY_SUFFIX }}" >> | |
| "$GITHUB_OUTPUT" | |
| - name: Create workflow run cache key | |
| id: run-cache-key | |
| run: >- | |
| echo "run-cache-key=${{ github.run_id }}-${{ github.run_attempt }}-${{ | |
| vars.RANDOM_CACHE_KEY_SUFFIX }}" >> "$GITHUB_OUTPUT" | |
| - name: Is a PR from a fork | |
| id: is-fork-pr | |
| run: >- | |
| echo "is-fork-pr=${{ github.event.pull_request.head.repo.fork }}" >> | |
| "$GITHUB_OUTPUT" | |
| - name: Detect changed files | |
| id: detect-changed-files | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| changed: | |
| - 'packages/**/*' | |
| list-files: json | |
| - name: Detect changed packages | |
| id: detect-changed-packages | |
| run: >- | |
| echo "changed-packages=$(node | |
| .github/workflows/wac/utils/runNodeScripts/listChangedPackages.js '${{ | |
| steps.detect-changed-files.outputs.changed_files }}')" >> | |
| "$GITHUB_OUTPUT" | |
| - name: Get latest Webiny version on NPM | |
| id: latest-webiny-version | |
| run: >- | |
| echo "latest-webiny-version=$(npm view @webiny/cli version)" >> | |
| "$GITHUB_OUTPUT" | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| assignMilestone: | |
| name: Assign milestone | |
| needs: constants | |
| if: >- | |
| needs.constants.outputs.is-fork-pr != 'true' && | |
| github.event.pull_request.milestone == null | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| - name: Print latest Webiny version | |
| run: echo ${{ needs.constants.outputs.latest-webiny-version }} | |
| - id: get-milestone-to-assign | |
| name: Get milestone to assign | |
| run: >- | |
| echo "milestone=$(node | |
| .github/workflows/wac/utils/runNodeScripts/getMilestoneToAssign.js | |
| '{"latestWebinyVersion":"${{ | |
| needs.constants.outputs.latest-webiny-version }}","baseBranch":"${{ | |
| github.base_ref }}"}')" >> "$GITHUB_OUTPUT" | |
| - uses: zoispag/action-assign-milestone@v1 | |
| if: steps.get-milestone-to-assign.outputs.milestone | |
| with: | |
| repo-token: ${{ secrets.GH_TOKEN }} | |
| milestone: ${{ steps.get-milestone-to-assign.outputs.milestone }} | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| build: | |
| name: Build | |
| needs: constants | |
| runs-on: webiny-build-packages | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.global-cache-key }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Build packages | |
| run: yarn build | |
| working-directory: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.run-cache-key }} | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| staticCodeAnalysis: | |
| needs: | |
| - constants | |
| name: Static code analysis | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.run-cache-key }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Check code formatting | |
| run: yarn prettier:check | |
| working-directory: ${{ github.base_ref }} | |
| - name: Check dependencies | |
| run: yarn adio | |
| working-directory: ${{ github.base_ref }} | |
| - name: Check TS configs | |
| run: yarn check-ts-configs | |
| working-directory: ${{ github.base_ref }} | |
| - name: ESLint | |
| run: yarn eslint | |
| working-directory: ${{ github.base_ref }} | |
| - name: Check Package Node Modules | |
| run: yarn check-package-dependencies | |
| working-directory: ${{ github.base_ref }} | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| staticCodeAnalysisVerifyDependencies: | |
| needs: | |
| - constants | |
| - build | |
| name: Static code analysis (verify dependencies) | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.run-cache-key }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Build packages | |
| run: yarn build | |
| working-directory: ${{ github.base_ref }} | |
| - name: Sync Dependencies Verification | |
| run: yarn verify-dependencies | |
| working-directory: ${{ github.base_ref }} | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| staticCodeAnalysisTs: | |
| name: Static code analysis (TypeScript) | |
| runs-on: webiny-build-packages | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Check types for Cypress tests | |
| run: yarn cy:ts | |
| working-directory: ${{ github.base_ref }} | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| vitest-constants: | |
| needs: | |
| - constants | |
| - build | |
| name: Vitest (No storage) - Constants | |
| outputs: | |
| vitest-test-commands: ${{ steps.list-vitest-test-commands.outputs.vitest-test-commands }} | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - id: list-vitest-test-commands | |
| name: List Vitest Test Commands | |
| working-directory: ${{ github.base_ref }} | |
| run: >- | |
| echo "vitest-test-commands=$(node | |
| .github/workflows/wac/utils/runNodeScripts/listVitestTestCommands.js | |
| '["", ${{ needs.constants.outputs.changed-packages }}]')" >> | |
| "$GITHUB_OUTPUT" | |
| - name: Packages to test with Vitest | |
| id: list-packages | |
| run: >- | |
| echo '${{ steps.list-vitest-test-commands.outputs.vitest-test-commands | |
| }}' | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| vitest-run: | |
| needs: | |
| - constants | |
| - build | |
| - vitest-constants | |
| name: ${{ matrix.testCommand.title }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| node: | |
| - 24 | |
| testCommand: ${{ fromJSON(needs.vitest-constants.outputs.vitest-test-commands) }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| AWS_REGION: eu-central-1 | |
| if: needs.vitest-constants.outputs.vitest-test-commands != '[]' | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.run-cache-key }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Build packages | |
| run: yarn build | |
| working-directory: ${{ github.base_ref }} | |
| - name: Run tests | |
| run: ${{ matrix.testCommand.cmd }} | |
| working-directory: ${{ github.base_ref }} | |
| vitest-ddb-constants: | |
| needs: | |
| - constants | |
| - build | |
| name: Vitest (DDB) - Constants | |
| outputs: | |
| vitest-test-commands: ${{ steps.list-vitest-test-commands.outputs.vitest-test-commands }} | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - id: list-vitest-test-commands | |
| name: List Vitest Test Commands | |
| working-directory: ${{ github.base_ref }} | |
| run: >- | |
| echo "vitest-test-commands=$(node | |
| .github/workflows/wac/utils/runNodeScripts/listVitestTestCommands.js | |
| '["ddb", ${{ needs.constants.outputs.changed-packages }}]')" >> | |
| "$GITHUB_OUTPUT" | |
| - name: Packages to test with Vitest | |
| id: list-packages | |
| run: >- | |
| echo '${{ steps.list-vitest-test-commands.outputs.vitest-test-commands | |
| }}' | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| vitest-ddb-run: | |
| needs: | |
| - constants | |
| - build | |
| - vitest-ddb-constants | |
| name: ${{ matrix.testCommand.title }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| node: | |
| - 24 | |
| testCommand: >- | |
| ${{ fromJSON(needs.vitest-ddb-constants.outputs.vitest-test-commands) | |
| }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| AWS_REGION: eu-central-1 | |
| WEBINY_STORAGE: ddb | |
| if: needs.vitest-ddb-constants.outputs.vitest-test-commands != '[]' | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs | |
| aws-region: eu-central-1 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.run-cache-key }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Build packages | |
| run: yarn build | |
| working-directory: ${{ github.base_ref }} | |
| - name: Run tests | |
| run: ${{ matrix.testCommand.cmd }} | |
| working-directory: ${{ github.base_ref }} | |
| permissions: | |
| id-token: write | |
| vitest-ddb-os-constants: | |
| needs: | |
| - constants | |
| - build | |
| name: Vitest (DDB+OS) - Constants | |
| outputs: | |
| vitest-test-commands: ${{ steps.list-vitest-test-commands.outputs.vitest-test-commands }} | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - id: list-vitest-test-commands | |
| name: List Vitest Test Commands | |
| working-directory: ${{ github.base_ref }} | |
| run: >- | |
| echo "vitest-test-commands=$(node | |
| .github/workflows/wac/utils/runNodeScripts/listVitestTestCommands.js | |
| '["ddb-os,ddb", ${{ needs.constants.outputs.changed-packages }}]')" >> | |
| "$GITHUB_OUTPUT" | |
| - name: Packages to test with Vitest | |
| id: list-packages | |
| run: >- | |
| echo '${{ steps.list-vitest-test-commands.outputs.vitest-test-commands | |
| }}' | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| vitest-ddb-os-run: | |
| needs: | |
| - constants | |
| - build | |
| - vitest-ddb-os-constants | |
| name: ${{ matrix.testCommand.title }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| node: | |
| - 24 | |
| testCommand: >- | |
| ${{ | |
| fromJSON(needs.vitest-ddb-os-constants.outputs.vitest-test-commands) | |
| }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
| AWS_REGION: eu-central-1 | |
| WEBINY_STORAGE: ddb-os,ddb | |
| AWS_OPENSEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_3_DOMAIN_NAME}} | |
| OPENSEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_3_ENDPOINT }} | |
| OPENSEARCH_INDEX_PREFIX: ${{ matrix.testCommand.id }} | |
| if: >- | |
| needs.vitest-ddb-os-constants.outputs.vitest-test-commands != '[]' && | |
| needs.constants.outputs.is-fork-pr != 'true' | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs | |
| aws-region: eu-central-1 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.base_ref }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.yarn/cache | |
| key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.base_ref }}/.webiny/cached-packages | |
| key: ${{ needs.constants.outputs.run-cache-key }} | |
| - name: Install dependencies | |
| run: yarn --immutable | |
| working-directory: ${{ github.base_ref }} | |
| - name: Build packages | |
| run: yarn build | |
| working-directory: ${{ github.base_ref }} | |
| - name: Run tests | |
| run: ${{ matrix.testCommand.cmd }} | |
| working-directory: ${{ github.base_ref }} | |
| permissions: | |
| id-token: write |