From 21116a6ede6bd14f442962d8ecd3ba1b01fba985 Mon Sep 17 00:00:00 2001 From: Dawntraoz Date: Wed, 24 Sep 2025 12:07:51 +0200 Subject: [PATCH 1/3] chore: create initial CI for CLI templates using nx run-many command, remove old workflows --- .github/workflows/ci-cli-templates.yaml | 26 +++++++++++++++++++ .../workflows/check-if-releasing-library.yml | 24 ----------------- .../.github/workflows/template-js.yml | 22 ---------------- .../.github/workflows/template-react.yml | 26 ------------------- .../.github/workflows/template-vue2.yml | 22 ---------------- .../.github/workflows/template-vue3.yml | 26 ------------------- 6 files changed, 26 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/ci-cli-templates.yaml delete mode 100644 packages/field-plugin/.github/workflows/check-if-releasing-library.yml delete mode 100644 packages/field-plugin/.github/workflows/template-js.yml delete mode 100644 packages/field-plugin/.github/workflows/template-react.yml delete mode 100644 packages/field-plugin/.github/workflows/template-vue2.yml delete mode 100644 packages/field-plugin/.github/workflows/template-vue3.yml diff --git a/.github/workflows/ci-cli-templates.yaml b/.github/workflows/ci-cli-templates.yaml new file mode 100644 index 00000000..19bc5ed3 --- /dev/null +++ b/.github/workflows/ci-cli-templates.yaml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: [main] + paths: + - "packages/field-plugin/**" + pull_request: + branches: [main] + paths: + - "packages/field-plugin/**" + +env: + HUSKY: 0 + NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 + +jobs: + build: + environment: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-node + + - name: Check + run: pnpm nx run-many --target=build,lint,test,test:types --parallel=3 -p="field-plugin-*-template" diff --git a/packages/field-plugin/.github/workflows/check-if-releasing-library.yml b/packages/field-plugin/.github/workflows/check-if-releasing-library.yml deleted file mode 100644 index 2355a387..00000000 --- a/packages/field-plugin/.github/workflows/check-if-releasing-library.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - workflow_call: - outputs: - result: - value: ${{ jobs.check-if-releasing-library.outputs.result }} - -jobs: - check-if-releasing-library: - runs-on: ubuntu-latest - outputs: - result: ${{ steps.validation.outputs.result }} - steps: - - uses: actions/checkout@v4 - - id: PR - uses: jwalton/gh-find-current-pr@v1 - - id: validation - run: | - if [[ "${{ steps.PR.outputs.title }}" == "chore(lib): release @storyblok/field-plugin@"* ]]; then - echo "releasing library" - echo "result=true" >> $GITHUB_OUTPUT - else - echo "not releasing library" - echo "result=false" >> $GITHUB_OUTPUT - fi diff --git a/packages/field-plugin/.github/workflows/template-js.yml b/packages/field-plugin/.github/workflows/template-js.yml deleted file mode 100644 index 53666f4a..00000000 --- a/packages/field-plugin/.github/workflows/template-js.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'ci-js-template' -on: - push: - paths: - - 'packages/cli/templates/js/**' - - 'packages/field-plugin/**' -jobs: - check-if-releasing-library: - uses: ./.github/workflows/check-if-releasing-library.yml - build: - needs: check-if-releasing-library - if: ${{ needs.check-if-releasing-library.outputs.result == 'false' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 22.18.0 - cache: 'yarn' - - run: yarn install - - run: yarn workspace field-plugin-js-template build diff --git a/packages/field-plugin/.github/workflows/template-react.yml b/packages/field-plugin/.github/workflows/template-react.yml deleted file mode 100644 index 554ba64a..00000000 --- a/packages/field-plugin/.github/workflows/template-react.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 'ci-react-template' -on: - push: - paths: - - 'packages/cli/templates/react/**' - - 'packages/field-plugin/**' -jobs: - check-if-releasing-library: - uses: ./.github/workflows/check-if-releasing-library.yml - test-and-build: - needs: check-if-releasing-library - if: ${{ needs.check-if-releasing-library.outputs.result == 'false' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 22.18.0 - cache: 'yarn' - - name: Install Dependencies - run: yarn install - - name: Build the template - run: yarn workspace field-plugin-react-template build - - name: Unit Tests - run: yarn workspace field-plugin-react-template test diff --git a/packages/field-plugin/.github/workflows/template-vue2.yml b/packages/field-plugin/.github/workflows/template-vue2.yml deleted file mode 100644 index bbcfea3d..00000000 --- a/packages/field-plugin/.github/workflows/template-vue2.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'ci-vue2-template' -on: - push: - paths: - - 'packages/cli/templates/vue2/**' - - 'packages/field-plugin/**' -jobs: - check-if-releasing-library: - uses: ./.github/workflows/check-if-releasing-library.yml - build: - needs: check-if-releasing-library - if: ${{ needs.check-if-releasing-library.outputs.result == 'false' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 22.18.0 - cache: 'yarn' - - run: yarn install - - run: yarn workspace field-plugin-vue2-template build diff --git a/packages/field-plugin/.github/workflows/template-vue3.yml b/packages/field-plugin/.github/workflows/template-vue3.yml deleted file mode 100644 index 0308544b..00000000 --- a/packages/field-plugin/.github/workflows/template-vue3.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 'ci-vue3-template' -on: - push: - paths: - - 'packages/cli/templates/vue3/**' - - 'packages/field-plugin/**' -jobs: - check-if-releasing-library: - uses: ./.github/workflows/check-if-releasing-library.yml - test-and-build: - needs: check-if-releasing-library - if: ${{ needs.check-if-releasing-library.outputs.result == 'false' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 22.18.0 - cache: 'yarn' - - name: Install Dependencies - run: yarn install - - name: Build the template - run: yarn workspace field-plugin-vue3-template build - - name: Unit Tests - run: yarn workspace field-plugin-vue3-template test From 84a1f1280c741c1664a3309e6b0f54edc23ded88 Mon Sep 17 00:00:00 2001 From: Dawntraoz Date: Wed, 24 Sep 2025 12:15:12 +0200 Subject: [PATCH 2/3] chore: reorder the commands when running in pipeline --- .github/workflows/ci-cli-templates.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cli-templates.yaml b/.github/workflows/ci-cli-templates.yaml index 19bc5ed3..127a2b14 100644 --- a/.github/workflows/ci-cli-templates.yaml +++ b/.github/workflows/ci-cli-templates.yaml @@ -1,4 +1,4 @@ -name: CI +name: CI Field Plugin CLI Templates on: push: @@ -22,5 +22,8 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-node - - name: Check - run: pnpm nx run-many --target=build,lint,test,test:types --parallel=3 -p="field-plugin-*-template" + - name: Build + run: pnpm nx run-many --target=build -p="field-plugin-*-template" + + - name: Test, lint and type check + run: pnpm nx run-many --target=lint,test,test:types --parallel=3 -p="field-plugin-*-template" From f897348a0b3246295e942e390a34e6d3682b34d0 Mon Sep 17 00:00:00 2001 From: Dawntraoz Date: Mon, 29 Sep 2025 10:52:20 +0200 Subject: [PATCH 3/3] chore: remove test script as part of the workflow due to monorepo limitations on versioning --- .github/workflows/ci-cli-templates.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cli-templates.yaml b/.github/workflows/ci-cli-templates.yaml index 127a2b14..cf6582f8 100644 --- a/.github/workflows/ci-cli-templates.yaml +++ b/.github/workflows/ci-cli-templates.yaml @@ -26,4 +26,4 @@ jobs: run: pnpm nx run-many --target=build -p="field-plugin-*-template" - name: Test, lint and type check - run: pnpm nx run-many --target=lint,test,test:types --parallel=3 -p="field-plugin-*-template" + run: pnpm nx run-many --target=lint,test:types --parallel=3 -p="field-plugin-*-template"