From a474b91fe2a335e191ffe67174e4ae58dbba4798 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:50:56 +0200 Subject: [PATCH 1/5] chore: separate the build_test into two different jobs to save time --- .github/workflows/build.yml | 40 +++++++++++++++++++ .../workflows/{build_test.yml => test.yml} | 26 +++--------- 2 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{build_test.yml => test.yml} (60%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..97a076af49 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Build + +on: + push: + branches: + - main + - release/* + pull_request: + branches: + - main + - release/* + + # Allows GitHub to use this workflow to validate the merge queue + merge_group: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + NODE_OPTIONS: --max_old_space_size=16384 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + - run: npm ci --no-audit --no-fund --prefer-offline + - run: npm run lint:errors + - run: npm run build:for:npm + - run: npm run generate:jsonschema:dist diff --git a/.github/workflows/build_test.yml b/.github/workflows/test.yml similarity index 60% rename from .github/workflows/build_test.yml rename to .github/workflows/test.yml index 6bccda7c83..199d177548 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Build and test +name: Test on: push: @@ -26,21 +26,15 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} - cache: 'npm' + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json - run: npm ci --no-audit --no-fund --prefer-offline - - run: npm run lint:errors - - run: npm run build - - run: npm run generate:jsonschema:dist - run: npx playwright install --with-deps - run: npm test - name: Upload Code Coverage reports @@ -50,13 +44,3 @@ jobs: name: code-coverage path: coverage/ retention-days: 30 - # Commented out since it is outdated and is quite spammy - # - name: Report code coverage - # uses: zgosalvez/github-actions-report-lcov@v2 - # if: always() - # continue-on-error: true - # with: - # coverage-files: coverage/lcov.info - # artifact-name: code-coverage-report - # github-token: ${{ secrets.GITHUB_TOKEN }} - # working-directory: ./ From 0c6f63cfeb4dd04a2c2080cb50dd5f9f56b6e169 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:00:40 +0200 Subject: [PATCH 2/5] chore: test with `build:for:cms` instead --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97a076af49..4a8f96ea58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,5 +36,5 @@ jobs: cache-dependency-path: ./package-lock.json - run: npm ci --no-audit --no-fund --prefer-offline - run: npm run lint:errors - - run: npm run build:for:npm + - run: npm run build:for:cms - run: npm run generate:jsonschema:dist From e4f6f28cb92c3117eaef437c700d3452deac21fe Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 2 Jul 2024 16:10:49 +0200 Subject: [PATCH 3/5] format --- src/rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rollup.config.js b/src/rollup.config.js index 67dacb42aa..b20eb1cd69 100644 --- a/src/rollup.config.js +++ b/src/rollup.config.js @@ -84,7 +84,7 @@ const libraries = allowed.map((module) => { preventAssignment: true, values: { '?inline': '', - } + }, }), css({ minify: true }), esbuild({ minify: true, sourceMap: true }), From 0de4cbad40a570152b9e439882d6dab86d0ec0f4 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:05:49 +0200 Subject: [PATCH 4/5] chore: merge separate workflows into parallel jobs --- .github/workflows/build.yml | 40 ------------------- .../workflows/{test.yml => build_test.yml} | 16 +++++++- 2 files changed, 15 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/build.yml rename .github/workflows/{test.yml => build_test.yml} (73%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 4a8f96ea58..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Build - -on: - push: - branches: - - main - - release/* - pull_request: - branches: - - main - - release/* - - # Allows GitHub to use this workflow to validate the merge queue - merge_group: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - NODE_OPTIONS: --max_old_space_size=16384 - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: npm - cache-dependency-path: ./package-lock.json - - run: npm ci --no-audit --no-fund --prefer-offline - - run: npm run lint:errors - - run: npm run build:for:cms - - run: npm run generate:jsonschema:dist diff --git a/.github/workflows/test.yml b/.github/workflows/build_test.yml similarity index 73% rename from .github/workflows/test.yml rename to .github/workflows/build_test.yml index 199d177548..341335e79d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/build_test.yml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Test +name: Build on: push: @@ -25,7 +25,21 @@ env: jobs: build: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + - run: npm ci --no-audit --no-fund --prefer-offline + - run: npm run lint:errors + - run: npm run build:for:cms + - run: npm run generate:jsonschema:dist + test: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Use Node.js From 63bf63da82a3b790d0eec4562d30d9f03be0c6eb Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:06:34 +0200 Subject: [PATCH 5/5] chore: update the name of workflow --- .github/workflows/build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 341335e79d..7c5ee7ee44 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Build +name: Build and test on: push: