Skip to content

Commit

Permalink
feat: add ability to not mock assets (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Apr 5, 2024
1 parent 13c0756 commit d4db704
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
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

0 comments on commit d4db704

Please sign in to comment.