Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to not mock assets #19

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ on:
default: '[]'
testsuites:
type: string
default: ''
database_seed:
type: boolean
default: false
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/test_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
type: string
database_seed:
type: boolean
default: false
database_name:
type: string
default: monica
Expand All @@ -26,6 +25,11 @@ on:
vite:
type: boolean
default: true
mock-assets:
type: boolean
default: true
node-version:
type: string

jobs:
#############
Expand Down Expand Up @@ -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
{\
Expand All @@ -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
{\
Expand Down