From 413b6abc0e21f16415123e19f0a91178667d3c1e Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 23 Mar 2024 17:26:13 +0100 Subject: [PATCH 1/2] add possibility to (not) mock assets --- .github/workflows/laravel.yml | 9 +++++++++ .github/workflows/test_website.yml | 25 +++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index a655a5d..7ad70c2 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -39,6 +39,13 @@ on: vite: type: boolean default: true + mock-assets: + required: false + type: boolean + default: true + node-version: + required: false + type: string secrets: SONAR_TOKEN: required: true @@ -76,6 +83,8 @@ jobs: database_name: ${{ inputs.database_name }} database_secret: ${{ inputs.database_secret }} vite: ${{ inputs.vite }} + mock-assets: ${{ inputs.mock-assets }} + node-version: ${{ inputs.node-version }} strategy: fail-fast: false diff --git a/.github/workflows/test_website.yml b/.github/workflows/test_website.yml index e3c23de..af77a80 100644 --- a/.github/workflows/test_website.yml +++ b/.github/workflows/test_website.yml @@ -26,6 +26,13 @@ on: vite: type: boolean default: true + mock-assets: + required: false + type: boolean + default: true + node-version: + required: false + type: string jobs: ############# @@ -76,12 +83,26 @@ jobs: - name: Install composer dependencies run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + # Yarn + - name: Setup Node.js + if: ${{ ! inputs.mock-assets }} + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: yarn + - name: Install yarn dependencies + if: ${{ ! inputs.mock-assets }} + run: yarn install --immutable + - name: Build assets + if: ${{ ! inputs.mock-assets }} + run: yarn run build + # Prepare - name: Prepare environment run: | cp tests/.env.ci.${{ inputs.connection }} .env - name: Mock assets - if: inputs.vite + if: inputs.vite && inputs.mock-assets run: | mkdir -p public/build/assets {\ @@ -95,7 +116,7 @@ jobs: echo "}"; \ } | tee public/build/manifest.json - name: Mock assets (mix) - if: ${{ ! inputs.vite }} + if: ${{ ! inputs.vite && inputs.mock-assets }} run: | mkdir -p public/js public/css {\ From 07000771830e1ef366db8e0ede59739e14e89a26 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 23 Mar 2024 17:39:05 +0100 Subject: [PATCH 2/2] update --- .github/workflows/laravel.yml | 3 --- .github/workflows/test_website.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 7ad70c2..7eb0a8a 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -26,7 +26,6 @@ on: default: '[]' testsuites: type: string - default: '' database_seed: type: boolean default: false @@ -40,11 +39,9 @@ on: type: boolean default: true mock-assets: - required: false type: boolean default: true node-version: - required: false type: string secrets: SONAR_TOKEN: diff --git a/.github/workflows/test_website.yml b/.github/workflows/test_website.yml index af77a80..ccd4743 100644 --- a/.github/workflows/test_website.yml +++ b/.github/workflows/test_website.yml @@ -16,7 +16,6 @@ on: type: string database_seed: type: boolean - default: false database_name: type: string default: monica @@ -27,11 +26,9 @@ on: type: boolean default: true mock-assets: - required: false type: boolean default: true node-version: - required: false type: string jobs: