Add building web assets to CI/CD

This commit is contained in:
Deon George 2025-01-03 15:38:07 +11:00
parent 8326416d90
commit 45695bde06

View File

@ -16,7 +16,8 @@ jobs:
name: Test Application name: Test Application
runs-on: docker-${{ matrix.arch }} runs-on: docker-${{ matrix.arch }}
container: container:
image: gitea.dege.au/docker/php:8.3-fpm-ldap-test image: docker:dind
privileged: true
steps: steps:
- name: Environment Setup - name: Environment Setup
@ -24,7 +25,7 @@ jobs:
# If we have a proxy use it # If we have a proxy use it
if [ -n "${HTTP_PROXY}" ]; then echo "HTTP PROXY [${HTTP_PROXY}]"; sed -i -e s'/https/http/' /etc/apk/repositories; fi if [ -n "${HTTP_PROXY}" ]; then echo "HTTP PROXY [${HTTP_PROXY}]"; sed -i -e s'/https/http/' /etc/apk/repositories; fi
# Some pre-reqs # Some pre-reqs
apk add git nodejs apk add git nodejs npm
## Some debugging info ## Some debugging info
# env|sort # env|sort
@ -33,20 +34,21 @@ jobs:
- name: Run Tests - name: Run Tests
run: | run: |
set -x
mv .env.testing .env mv .env.testing .env
# Install Composer and project dependencies. # Install Composer and project dependencies.
mkdir -p ${COMPOSER_HOME} mkdir -p ${COMPOSER_HOME}
if [ -n "${{ secrets.COMPOSER_GITHUB_TOKEN }}" ]; then composer config github-oauth.github.com ${{ secrets.COMPOSER_GITHUB_TOKEN }}; fi if [ -n "${{ secrets.COMPOSER_GITHUB_TOKEN }}" ]; then composer config github-oauth.github.com ${{ secrets.COMPOSER_GITHUB_TOKEN }}; fi
composer install composer install
# Generate an application key. Re-cache. # Generate an application key. Re-cache.
php artisan key:generate # php artisan key:generate
# php artisan migrate # php artisan migrate
# php artisan db:seed # php artisan db:seed
# run laravel tests # run laravel tests
XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text --colors=never # XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text --colors=never
# Build assets # Build assets
nmp i npm i
nmp run prod npm run prod
echo 'TESTS RUN' > TESTS.RUN echo 'TESTS RUN' > TESTS.RUN
ls -al ls -al