From 49e7b7325d64e83b83281a6a436a4dccc71e2315 Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Sat, 20 Jan 2024 16:31:30 +0100 Subject: [PATCH] Add builds checking whether the frontend can be built with all supported nodejs versions Co-authored-by: jaroslavtyc.com --- .github/workflows/ci__full.yaml | 6 ++++ .github/workflows/ci__minimal.yaml | 6 ++++ .github/workflows/ci_frontend.yaml | 51 ++++++++++++++++++++++++++++++ .github/workflows/matrix.json | 23 ++++++++++++++ package.json | 2 +- 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci_frontend.yaml diff --git a/.github/workflows/ci__full.yaml b/.github/workflows/ci__full.yaml index 19fc96af7c..0dcb58edce 100644 --- a/.github/workflows/ci__full.yaml +++ b/.github/workflows/ci__full.yaml @@ -35,6 +35,12 @@ jobs: name: End-to-end tests (Custom) needs: static-checks uses: ./.github/workflows/ci_e2e-custom.yaml + frontend: + name: Frontend + needs: static-checks + uses: ./.github/workflows/ci_frontend.yaml + with: + type: full packages: name: Packages needs: static-checks diff --git a/.github/workflows/ci__minimal.yaml b/.github/workflows/ci__minimal.yaml index 1f2f7fdbe4..93912dbb5e 100644 --- a/.github/workflows/ci__minimal.yaml +++ b/.github/workflows/ci__minimal.yaml @@ -43,6 +43,12 @@ jobs: name: End-to-end tests (Custom) needs: static-checks uses: ./.github/workflows/ci_e2e-custom.yaml + frontend: + name: Frontend + needs: static-checks + uses: ./.github/workflows/ci_frontend.yaml + with: + type: minimal packages: name: Packages needs: static-checks diff --git a/.github/workflows/ci_frontend.yaml b/.github/workflows/ci_frontend.yaml new file mode 100644 index 0000000000..accfe5b347 --- /dev/null +++ b/.github/workflows/ci_frontend.yaml @@ -0,0 +1,51 @@ +name: Frontend + +on: + workflow_dispatch: ~ + workflow_call: + inputs: + type: + description: "Type of the build" + required: true + type: string + +jobs: + get-matrix: + runs-on: ubuntu-latest + name: "Get matrix" + outputs: + matrix: ${{ steps.matrix.outputs.prop }} + steps: + - uses: actions/checkout@v3 + - name: "Get matrix" + id: matrix + uses: notiz-dev/github-action-json-property@release + with: + path: '.github/workflows/matrix.json' + prop_path: '${{ inputs.type }}.frontend' + + frontend: + needs: get-matrix + runs-on: ubuntu-latest + name: "NodeJS ${{ matrix.node }}" + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }} + + env: + APP_ENV: test_cached + DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?charset=utf8mb4&serverVersion=8.0" + + steps: + - + uses: actions/checkout@v3 + + - name: Build application + uses: SyliusLabs/BuildTestAppAction@v2.0 + with: + build_type: "sylius" + e2e_js: "yes" + database_version: "8.0" + php_version: "8.1" + symfony_version: "6.4.*" + node_version: ${{ matrix.node }} diff --git a/.github/workflows/matrix.json b/.github/workflows/matrix.json index 07c4ddee5d..e7209e920d 100644 --- a/.github/workflows/matrix.json +++ b/.github/workflows/matrix.json @@ -64,6 +64,13 @@ } ] }, + "frontend": { + "include": [ + { + "node": "20.x" + } + ] + }, "packages": { "include": [ { @@ -176,6 +183,22 @@ } ] }, + "frontend": { + "include": [ + { + "node": "14.x" + }, + { + "node": "16.x" + }, + { + "node": "18.x" + }, + { + "node": "20.x" + } + ] + }, "packages": { "php": [ "8.0", "8.1" ], "symfony": [ "^5.4", "^6.4" ], diff --git a/package.json b/package.json index fa10764309..fd09711445 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "yargs": "^17.5.1" }, "engines": { - "node": "^14 || ^16 || ^18" + "node": "^14 || ^16 || ^18 || ^20" }, "engineStrict": true, "scripts": {