Skip to content

feat(server):validate duplicate modules #13834

feat(server):validate duplicate modules

feat(server):validate duplicate modules #13834

Workflow file for this run

name: Continuous Integration
concurrency: ${{ github.ref }}
on:
workflow_dispatch:
inputs:
nx-base:
type: string
description: Commit SHA, branch or tag name used by Nx in the affected jobs.
required: true
default: next
nx-skip-cache:
type: boolean
description: Rerun the tasks even when the results are available in the cache.
default: false
nx-force-all:
type: boolean
description: Forces Nx to consider all projects (apps and libs) as affected.
default: false
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
- next
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_BRANCH: ${{ github.head_ref || github.ref_name }}
NX_FORCE_ALL: ${{ fromJSON('["", "--all"]')[ inputs.nx-force-all ] }} # This relies on type coercion, an implicit cast from boolean true to 1 or false to 0, which is then used as array index.
NX_AFFECTED_OR_ALL: ${{ fromJSON('["affected", "run-many --all"]')[ inputs.nx-force-all ] }}
NX_SKIP_NX_CACHE: ${{ inputs.nx-skip-cache || false }}
BASE: ${{ github.base_ref || inputs.nx-base || github.event.repository.default_branch }}
jobs:
ci:
name: Continuous Integration
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.head_ref != 'next' ) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
with:
main-branch-name: ${{ env.BASE }}
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Cache global node modules
id: cache-node-modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: npm ci
- name: Nx Workspace Lint
run: npx nx workspace-lint
- name: Nx Format Check
run: npx nx format:check $NX_FORCE_ALL
- name: Lint
run: npx nx $NX_AFFECTED_OR_ALL --target=lint --parallel=3
- name: Build
run: |
npx nx $NX_AFFECTED_OR_ALL --target=build --parallel=3
npx nx $NX_AFFECTED_OR_ALL --target=postbuild --parallel=3
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Test
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npx nx $NX_AFFECTED_OR_ALL --target=test --coverage --maxWorkers=${{ steps.cpu-cores.outputs.count }}
nx:
name: Nx
needs: ci
if: ${{ github.ref_name == 'master' || github.ref_name == 'next' }}
uses: ./.github/workflows/nx.template.yml
with:
nx-head: ${{ github.head_ref && format('refs/pull/{0}/merge', github.event.number) || github.ref_name }}
nx-base: ${{ github.base_ref || inputs.nx-base || github.event.repository.default_branch }}
nx-skip-cache: ${{ inputs.nx-skip-cache || false }} # This relies on type coercion, an implicit cast from boolean true to 1 or false to 0, which is then used as array index.
nx-force-all: ${{ inputs.nx-force-all || false }}
release:
name: Release
needs: nx
uses: ./.github/workflows/release.template.yml
if: ${{ github.ref_name == 'master' || github.ref_name == 'next' }}
with:
default-branch: ${{ github.event.repository.default_branch }}
branch: ${{ github.ref_name }}
affected-apps: ${{ needs.nx.outputs.affected-apps }}
affected-lib: ${{ needs.nx.outputs.affected-lib }}
affected-package-container: ${{ needs.nx.outputs.affected-package-container }}
affected-deploy-static: ${{ needs.nx.outputs.affected-deploy-static }}
affected-deploy-container: ${{ needs.nx.outputs.affected-deploy-container }}
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}