Skip to content

chore(deps): 🔗 update dependency ajv to v8.18.0 [security] #414

chore(deps): 🔗 update dependency ajv to v8.18.0 [security]

chore(deps): 🔗 update dependency ajv to v8.18.0 [security] #414

name: Generators Integration Tests
on:
pull_request:
branches:
- master
- alpha-*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: 'Run tests'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:library --name=my-library --directory=libs/examples/my-library --tags=social-qa && pnpm nx lint my-library',
successRegexp: 'Successfully ran target lint for project my-library',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:core-module --name my-module --directory libs/examples/my-module --tags domain:social-qa && pnpm nx test my-module-module',
successRegexp: 'Successfully ran target test for project my-module-module',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:core-module --name my-module --directory libs/examples/my-module --tags domain:social-qa && pnpm nx lint my-module-module',
successRegexp: 'Successfully ran target lint for project my-module-module',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:core-module --name my-module --directory libs/examples/my-module --tags domain:social-qa && pnpm nx e2e my-module-module-e2e',
successRegexp: 'Successfully ran target e2e for project my-module-module-e2e',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:components-library --name my-components --directory libs/examples/my-components --tags domain:social-qa && pnpm nx test my-components-ui',
successRegexp: 'Successfully ran target test for project my-components-ui',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:components-library --name my-components --directory libs/examples/my-components --tags domain:social-qa && pnpm nx lint my-components-ui',
successRegexp: 'Successfully ran target lint for project my-components-ui',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory libs/my-feature/services/my-data --serviceType=apollo --tags=domain:social-qa --useDefaultCrudFunctions && pnpm nx lint my-data-service',
successRegexp: 'Successfully ran target lint for project my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory libs/my-feature/services/my-data --serviceType=apollo --tags=domain:social-qa --useDefaultCrudFunctions && pnpm nx test my-data-service',
successRegexp: 'Successfully ran target test for project my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory libs/my-feature/services/my-data --serviceType=react-query --tags=domain:social-qa --useDefaultCrudFunctions && pnpm nx lint my-data-service',
successRegexp: 'Successfully ran target lint for project my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory libs/my-feature/services/my-data --serviceType=react-query --tags=domain:social-qa --useDefaultCrudFunctions && pnpm nx test my-data-service',
successRegexp: 'Successfully ran target test for project my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=apps/example/my-app --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && NODE_OPTIONS="--max-old-space-size=8192" pnpm nx e2e my-app-e2e',
successRegexp: 'Successfully ran target e2e for project my-app-e2e',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=apps/example/my-app --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm nx test my-app',
successRegexp: 'Successfully ran target test for project my-app',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=apps/example/my-app --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm nx lint my-app',
successRegexp: 'Successfully ran target lint for project my-app',
}
- {
packageCommand: 'pnpm exec nx g @brainly-gene/tools:bff-app --name=web-app --directory=apps/examples/web-app --reactQuery=true --rewrites=true --tags=domain:social-qa && pnpm nx lint web-app',
successRegexp: 'Successfully ran target lint for project web-app',
}
- {
packageCommand: 'pnpm exec nx g @brainly-gene/tools:bff-app --name=web-app --directory=apps/examples/web-app --reactQuery=true --rewrites=true --tags=domain:social-qa && pnpm nx e2e web-app-e2e',
successRegexp: 'Successfully ran target e2e for project web-app-e2e',
}
- {
packageCommand: 'pnpm nx generate @nx/workspace:remove --projectName=assets && pnpm nx g @brainly-gene/tools:assets-library --withStyleGuide=true && pnpm nx lint assets',
successRegexp: 'Successfully ran target lint for project assets',
}
- {
packageCommand: 'pnpm nx generate @nx/workspace:remove --projectName=translations && pnpm nx g @brainly-gene/tools:translations-library && pnpm nx lint translations',
successRegexp: 'Successfully ran target lint for project translations',
}
- {
packageCommand: 'pnpm nx generate @nx/workspace:remove --projectName=e2e-testing-providers && pnpm exec nx generate @brainly-gene/tools:e2e-providers && pnpm nx lint e2e-testing-providers --fix',
successRegexp: 'Successfully ran target lint for project e2e-testing-providers',
}
- {
packageCommand: 'pnpm nx generate @nx/workspace:remove --projectName=assets && pnpm nx generate @nx/workspace:remove --projectName=translations && pnpm exec nx generate @brainly-gene/tools:gene-workspace && echo "successfully generated gene workspace"',
successRegexp: 'successfully generated gene workspace',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:library --name=my-library --directory=libs/examples/my-library --tags=social-qa && pnpm nx g @brainly-gene/tools:subapp --library=my-library --name=my-subapp --directory=my-subapp --tags=domain:social-qa && pnpm nx run my-library:lint --fix',
successRegexp: 'Successfully ran target lint for project my-library',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=apps/example/my-app --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm exec nx generate @brainly-gene/tools:module --name=my-example --appName=my-app --e2e=true --shouldAutoprefix=true --no-interactive && pnpm exec nx generate @brainly-gene/tools:module --name=my-example2 --appName=my-app --e2e=true --shouldAutoprefix=true --no-interactive && pnpm exec nx run-many --target=lint --projects=my-app,my-app-e2e',
successRegexp: 'Successfully ran target lint for 2 projects',
}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
with:
node-version: '22.17.1'
- uses: pnpm/action-setup@v4
with:
version: 9.12.0
- name: Restore cached npm dependencies
uses: actions/cache/restore@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
with:
path: node_modules
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: Restore cached Cypress binary
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
with:
path: ~/.cache/Cypress
key: cypress-cache-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Cypress binary
run: |
npx cypress install
- name: Cache npm dependencies
uses: actions/cache/save@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
with:
path: node_modules
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: Cache Cypress binary
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
with:
path: ~/.cache/Cypress
key: cypress-cache-${{ hashFiles('pnpm-lock.yaml') }}
- name: Run script and check stdout
uses: ./.github/actions/generators-integration-tests
timeout-minutes: 10
with:
packageCommand: ${{ matrix.config.packageCommand }}
successRegexp: ${{ matrix.config.successRegexp }}
generators-integration-summary:
name: 'Summary check'
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Successful Generator tests
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing Generator tests
if: ${{ contains(needs.*.result, 'failure') }}
run: |
echo "Some Generator tests failed - please look on particular job logs for more details."
exit 1