From e3912244e93d22178b553ec08aa92670023a9619 Mon Sep 17 00:00:00 2001 From: Artem Belik Date: Wed, 29 Oct 2025 11:28:58 +0300 Subject: [PATCH 1/2] chore: improved ci workflows (#DS-3875) --- .../actions/build-packages/action.yml | 2 +- .../workflows/actions/setup-node/action.yml | 16 +++++ .../workflows/actions/setup-yarn/action.yml | 17 ------ .github/workflows/api.yml | 16 +++++ .github/workflows/ci.yml | 58 ------------------- .github/workflows/commitlint.yml | 11 ++++ .github/workflows/docs-next.yml | 4 +- .github/workflows/docs-stable.yml | 4 +- .github/workflows/e2e-update-screenshots.yml | 4 +- .github/workflows/e2e.yml | 4 +- .github/workflows/license.yml | 15 +++++ .github/workflows/linters.yml | 19 ++++++ .github/workflows/pr-docs-preview.yml | 4 +- .github/workflows/publish.yml | 4 +- .github/workflows/units.yml | 23 ++++++++ package.json | 5 +- 16 files changed, 116 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/actions/setup-node/action.yml delete mode 100644 .github/workflows/actions/setup-yarn/action.yml create mode 100644 .github/workflows/api.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/commitlint.yml create mode 100644 .github/workflows/license.yml create mode 100644 .github/workflows/linters.yml create mode 100644 .github/workflows/units.yml diff --git a/.github/workflows/actions/build-packages/action.yml b/.github/workflows/actions/build-packages/action.yml index ed605d9e09..4fc2de99af 100644 --- a/.github/workflows/actions/build-packages/action.yml +++ b/.github/workflows/actions/build-packages/action.yml @@ -1,5 +1,5 @@ name: Build packages -description: Common setup steps used by our workflows +description: Build all koobiq packages runs: using: composite steps: diff --git a/.github/workflows/actions/setup-node/action.yml b/.github/workflows/actions/setup-node/action.yml new file mode 100644 index 0000000000..08f7ec752b --- /dev/null +++ b/.github/workflows/actions/setup-node/action.yml @@ -0,0 +1,16 @@ +name: Setup Node +description: Setup Node.js environment and install dependencies +runs: + using: composite + steps: + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: 'yarn' + cache-dependency-path: yarn.lock + registry-url: https://registry.npmjs.org/ + + - name: Install Dependencies + shell: bash + run: yarn install --immutable diff --git a/.github/workflows/actions/setup-yarn/action.yml b/.github/workflows/actions/setup-yarn/action.yml deleted file mode 100644 index 68960bf85f..0000000000 --- a/.github/workflows/actions/setup-yarn/action.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Setup Yarn -description: Common setup steps used by our workflows -runs: - using: composite - steps: - - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: '**/yarn.lock' - - - name: Install - shell: bash - run: yarn install --immutable diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml new file mode 100644 index 0000000000..17b07faedd --- /dev/null +++ b/.github/workflows/api.yml @@ -0,0 +1,16 @@ +name: API + +on: + push: + branches: + - main + pull_request: + +jobs: + api: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/actions/setup-node + - uses: ./.github/workflows/actions/build-packages + - run: yarn run check-api diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9bac67d7a1..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: CI - -on: - push: - branches: - - main - pull_request: - -permissions: read-all - -jobs: - general_checks: - name: General Checks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Yarn - uses: ./.github/workflows/actions/setup-yarn - - - name: Build packages - uses: ./.github/workflows/actions/build-packages - - - name: Commitlint - if: ${{ github.event_name == 'pull_request' }} - id: commitlint - continue-on-error: true - run: echo "${{ github.event.pull_request.title }}" | yarn commitlint - - - name: API Golden Checks - id: golden_checks - run: yarn run check-api - - - name: Linters - id: linters - if: ${{ success() || failure() && steps.golden_checks.conclusion == 'failure' }} - run: | - yarn run cspell --no-progress - yarn run prettier - yarn run stylelint --max-warnings=0 - yarn run eslint --max-warnings=0 - - - name: Unit - id: units - if: ${{ success() || failure() && (steps.linters.conclusion == 'failure' || steps.golden_checks.conclusion == 'failure') }} - run: | - yarn run unit:cdk - yarn run unit:components - yarn run unit:angular-moment-adapter - yarn run unit:angular-luxon-adapter - yarn run unit:schematics - yarn run unit:koobiq-docs - yarn run unit:api-gen - yarn run unit:components-experimental - - - name: License validation - run: yarn run validate:license - if: ${{ success() || failure() && (steps.linters.conclusion == 'failure' || steps.golden_checks.conclusion == 'failure' || steps.units.conclusion == 'failure') }} diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000000..a69ceb843d --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,11 @@ +name: Commitlint + +on: [pull_request] + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/actions/setup-node + - run: echo "${{ github.event.pull_request.title }}" | yarn commitlint --verbose diff --git a/.github/workflows/docs-next.yml b/.github/workflows/docs-next.yml index 40a6172732..c7a1d36a8a 100644 --- a/.github/workflows/docs-next.yml +++ b/.github/workflows/docs-next.yml @@ -18,8 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Yarn - uses: ./.github/workflows/actions/setup-yarn + - name: Setup Node + uses: ./.github/workflows/actions/setup-node - name: Build packages uses: ./.github/workflows/actions/build-packages diff --git a/.github/workflows/docs-stable.yml b/.github/workflows/docs-stable.yml index 101529d708..e9c1c300cb 100644 --- a/.github/workflows/docs-stable.yml +++ b/.github/workflows/docs-stable.yml @@ -16,8 +16,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Yarn - uses: ./.github/workflows/actions/setup-yarn + - name: Setup Node + uses: ./.github/workflows/actions/setup-node - name: Build packages uses: ./.github/workflows/actions/build-packages diff --git a/.github/workflows/e2e-update-screenshots.yml b/.github/workflows/e2e-update-screenshots.yml index fde0aecfcb..04a9be180d 100644 --- a/.github/workflows/e2e-update-screenshots.yml +++ b/.github/workflows/e2e-update-screenshots.yml @@ -19,8 +19,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup yarn - uses: ./.github/workflows/actions/setup-yarn + - name: Setup Node + uses: ./.github/workflows/actions/setup-node - name: Setup test environment run: yarn run e2e:setup diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6cdcf18130..4afda5359f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -18,8 +18,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup yarn - uses: ./.github/workflows/actions/setup-yarn + - name: Setup Node + uses: ./.github/workflows/actions/setup-node - name: Setup test environment run: yarn run e2e:setup diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml new file mode 100644 index 0000000000..1168e636ec --- /dev/null +++ b/.github/workflows/license.yml @@ -0,0 +1,15 @@ +name: License validation + +on: + push: + branches: + - main + pull_request: + +jobs: + license_validation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/actions/setup-node + - run: yarn run validate:license diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000000..97dcb99868 --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,19 @@ +name: Linters + +on: + push: + branches: + - main + pull_request: + +jobs: + linters: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/actions/setup-node + - run: | + yarn run cspell --no-progress + yarn run prettier + yarn run stylelint --max-warnings=0 + yarn run eslint --max-warnings=0 diff --git a/.github/workflows/pr-docs-preview.yml b/.github/workflows/pr-docs-preview.yml index 103cf077b3..75db5471e5 100644 --- a/.github/workflows/pr-docs-preview.yml +++ b/.github/workflows/pr-docs-preview.yml @@ -22,8 +22,8 @@ jobs: repository: ${{github.event.pull_request.head.repo.full_name}} fetch-depth: 0 - - name: Setup Yarn - uses: ./.github/workflows/actions/setup-yarn + - name: Setup Node + uses: ./.github/workflows/actions/setup-node - name: Build Packages uses: ./.github/workflows/actions/build-packages diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c350c9b491..6f99d4fa2e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,8 +20,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Yarn - uses: ./.github/workflows/actions/setup-yarn + - name: Setup Node + uses: ./.github/workflows/actions/setup-node - name: Build packages uses: ./.github/workflows/actions/build-packages diff --git a/.github/workflows/units.yml b/.github/workflows/units.yml new file mode 100644 index 0000000000..215e1f31d9 --- /dev/null +++ b/.github/workflows/units.yml @@ -0,0 +1,23 @@ +name: Unit tests + +on: + push: + branches: + - main + pull_request: + +jobs: + unit_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/actions/setup-node + - run: | + yarn run unit:cdk + yarn run unit:components + yarn run unit:angular-moment-adapter + yarn run unit:angular-luxon-adapter + yarn run unit:schematics + yarn run unit:koobiq-docs + yarn run unit:api-gen + yarn run unit:components-experimental diff --git a/package.json b/package.json index 6eda2cefb7..38d15fc950 100644 --- a/package.json +++ b/package.json @@ -188,6 +188,7 @@ "docs:build": "ng build koobiq-docs --configuration production", "docs:update-versions": "ts-node --project tools/update-doc-versions/tsconfig.json tools/update-doc-versions/update-doc-versions.ts", "docs:api-gen": "rimraf dist/api-gen && rollup -c tools/api-gen/rollup.config.js && node dist/api-gen/generate-api-docs.mjs", + "validate:license": "ts-node --project ./tools/validate-licenses/tsconfig.json ./tools/validate-licenses/validate-licenses.ts", "-----RELEASE-----": "----------------------------------------------------------------------------------------", "release:extract-changelog": "ts-node --project tools/extract-release-notes/tsconfig.json tools/extract-release-notes", "release:stage": "ts-node --project packages/cli/tsconfig.lib.json packages/cli/src/cli stage", @@ -288,10 +289,10 @@ "-----E2E_TESTS-----": "--------------------------------------------------------------------------------------", "e2e:setup": "playwright install chromium --with-deps", "e2e:components": "playwright test ./packages/components-dev/e2e/components", - "-----CI-----": "---------------------------------------------------------------------------------------------", + "-----API-----": "--------------------------------------------------------------------------------------------", "approve-api": "ts-node --project tools/api-extractor/tsconfig.json tools/api-extractor/api-extractor.ts", "check-api": "yarn run approve-api onlyCheck", - "validate:license": "ts-node --project ./tools/validate-licenses/tsconfig.json ./tools/validate-licenses/validate-licenses.ts", + "-----LINTERS-----": "----------------------------------------------------------------------------------------", "eslint": "eslint . --ext='.js,.ts,.html'", "eslint:fix": "yarn run eslint --fix", "stylelint": "stylelint '**/*.{css,scss}'", From 7b0d45749baa02f3ce77c4487d5760def07cefe6 Mon Sep 17 00:00:00 2001 From: Artem Belik Date: Wed, 29 Oct 2025 15:59:22 +0300 Subject: [PATCH 2/2] refactor: units --- .github/workflows/units.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/units.yml b/.github/workflows/units.yml index 215e1f31d9..cef3b09196 100644 --- a/.github/workflows/units.yml +++ b/.github/workflows/units.yml @@ -12,6 +12,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/setup-node + # Build styles which are required for karma/jasmine tests + - run: yarn run styles:build-all - run: | yarn run unit:cdk yarn run unit:components