Skip to content

feat: api core sql #12553

feat: api core sql

feat: api core sql #12553

Workflow file for this run

# 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@v5
with:
node-version: 24
- uses: actions/checkout@v5
- uses: webiny/action-conventional-commits@v1.4.2
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
- uses: webiny/action-conventional-commits@v1.4.2
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 }}
skip-ai-fix: ${{ steps.skip-ai-fix-check.outputs.skip-ai-fix }}
steps:
- uses: actions/setup-node@v5
with:
node-version: 24
- uses: actions/checkout@v5
- 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@v4
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"
- name: Check if AI fix should be skipped
id: skip-ai-fix-check
run: >-
echo "skip-ai-fix=$(if git log -1 --format=%B ${{
github.event.pull_request.head.sha }} | grep -q '\[skip-ai\]'; then
echo 'true'; else echo 'false'; fi)" >> "$GITHUB_OUTPUT"
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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@v5
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
buildProject:
needs:
- constants
- build
name: Build project (core, api, admin)
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
WEBINY_INFRA_API_MAX_BUNDLE_SIZE: ${{ vars.WEBINY_INFRA_API_MAX_BUNDLE_SIZE }}
steps:
- uses: actions/setup-node@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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: Build core
run: yarn webiny build core
working-directory: ${{ github.base_ref }}
- name: API bundle size limit
run: >-
echo "API bundle size limit:
${WEBINY_INFRA_API_MAX_BUNDLE_SIZE:-4718592} bytes"
- name: Build api
run: yarn webiny build api --no-deployment-checks
working-directory: ${{ github.base_ref }}
- name: Build admin
run: yarn webiny build admin --no-deployment-checks
working-directory: ${{ github.base_ref }}
runs-on: ubuntu-latest
staticCodeAnalysis:
needs:
- constants
name: Static code analysis
steps:
- uses: actions/setup-node@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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 format: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: Lint
run: yarn lint
working-directory: ${{ github.base_ref }}
- name: Check Package Node Modules
run: yarn check-package-dependencies
working-directory: ${{ github.base_ref }}
- name: Validate webiny package
run: yarn webiny-scripts validate-webiny-package
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
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
aiFixStaticAnalysis:
name: AI Fix Static Analysis
needs:
- constants
- staticCodeAnalysis
if: >-
failure() && github.event.pull_request.user.login == 'adrians5j' &&
needs.staticCodeAnalysis.result == 'failure' &&
needs.constants.outputs.is-fork-pr != 'true' &&
needs.constants.outputs.skip-ai-fix != 'true'
permissions:
contents: write
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
steps:
- uses: actions/setup-node@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
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: Fix lint issues (auto-fixable)
run: yarn lint:fix
working-directory: ${{ github.base_ref }}
continue-on-error: true
- name: Fix code formatting
run: yarn format:fix
working-directory: ${{ github.base_ref }}
continue-on-error: true
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code
- name: AI Fix Remaining Issues
working-directory: ${{ github.base_ref }}
run: >-
claude --dangerously-skip-permissions -p "Some static analysis checks
may still be failing. Fix any remaining issues: 1. Run 'yarn adio' —
if it reports dependency errors, fix the relevant package.json files.
2. Run 'yarn check-ts-configs' — if it reports errors, fix them. 3.
Run 'yarn lint' — if there are still non-auto-fixable errors, read the
affected files and fix them. 4. Run 'yarn check-package-dependencies'
— if it reports errors, fix them. Work in the current directory."
- name: Update yarn.lock
run: yarn
working-directory: ${{ github.base_ref }}
- name: Commit fixes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: ai fix static analysis [skip-ai]'
repository: ${{ github.base_ref }}
runs-on: ubuntu-latest
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
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@v5
with:
node-version: 24
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6.0.0
with:
role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs
aws-region: eu-central-1
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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@v5
with:
node-version: 24
- uses: actions/checkout@v5
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.OPENSEARCH_DOMAIN_NAME }}
OPENSEARCH_ENDPOINT: ${{ secrets.OPENSEARCH_ENDPOINT }}
OPENSEARCH_USERNAME: ${{ secrets.OPENSEARCH_USERNAME }}
OPENSEARCH_PASSWORD: ${{ secrets.OPENSEARCH_PASSWORD }}
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@v5
with:
node-version: 24
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6.0.0
with:
role-to-assume: arn:aws:iam::726952677045:role/GitHubActionsWebinyJs
aws-region: eu-central-1
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v5
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