diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index a655a5d..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 @@ -39,6 +38,11 @@ on: vite: type: boolean default: true + mock-assets: + type: boolean + default: true + node-version: + type: string secrets: SONAR_TOKEN: required: true @@ -76,6 +80,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..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 @@ -26,6 +25,11 @@ on: vite: type: boolean default: true + mock-assets: + type: boolean + default: true + node-version: + type: string jobs: ############# @@ -76,12 +80,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 +113,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 {\