Add builds checking whether the frontend can be built with all supported nodejs versions

Co-authored-by: jaroslavtyc.com <mail@jaroslavtyc.com>
This commit is contained in:
Jacob Tobiasz 2024-01-20 16:31:30 +01:00
parent c3da0dc9f8
commit 49e7b7325d
No known key found for this signature in database
GPG key ID: 3F84290201B006E0
5 changed files with 87 additions and 1 deletions

View file

@ -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

View file

@ -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

51
.github/workflows/ci_frontend.yaml vendored Normal file
View file

@ -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 }}

View file

@ -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" ],

View file

@ -47,7 +47,7 @@
"yargs": "^17.5.1"
},
"engines": {
"node": "^14 || ^16 || ^18"
"node": "^14 || ^16 || ^18 || ^20"
},
"engineStrict": true,
"scripts": {