Optimize CI testing and web dependencies (#2899)
This commit is contained in:
parent
31c55a2c0a
commit
f44261b29b
|
@ -8,7 +8,6 @@
|
||||||
!resources/locale/compiled
|
!resources/locale/compiled
|
||||||
!util/docker/web
|
!util/docker/web
|
||||||
!util/openapi.php
|
!util/openapi.php
|
||||||
!vendor
|
|
||||||
!web
|
!web
|
||||||
!templates
|
!templates
|
||||||
!plugins
|
!plugins
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
FROM azuracast/azuracast_testing:latest
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
RUN chmod a+x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["/bin/true"]
|
|
@ -0,0 +1,5 @@
|
||||||
|
name: AzuraCast Build and Test
|
||||||
|
description: Import translated locales, build static assets and run unit tests.
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Install Composer dependencies
|
||||||
|
composer install --no-interaction
|
||||||
|
|
||||||
|
# Import locales on backend
|
||||||
|
php bin/console locale:import
|
||||||
|
|
||||||
|
# Install NPM dependencies
|
||||||
|
cd frontend
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
# Import locales on frontend
|
||||||
|
npm run import-locales
|
||||||
|
|
||||||
|
# Build frontend assets
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
eval "$@"
|
|
@ -7,6 +7,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.github'
|
- '.github'
|
||||||
branches:
|
branches:
|
||||||
|
- ci-testing
|
||||||
- master
|
- master
|
||||||
- stable
|
- stable
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -22,35 +23,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git gc --prune=now --aggressive
|
git gc --prune=now --aggressive
|
||||||
|
|
||||||
- name: Get Composer Cache Directory
|
|
||||||
id: composer-cache
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
||||||
|
|
||||||
- name: Cache Composer Downloads
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-composer-
|
|
||||||
|
|
||||||
- name: Cache PHP dependencies
|
- name: Cache PHP dependencies
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
|
||||||
|
|
||||||
- name: Install Composer Dependencies
|
|
||||||
uses: php-actions/composer@master
|
|
||||||
with:
|
|
||||||
command: install
|
|
||||||
|
|
||||||
- name: Build base Docker image.
|
|
||||||
run: |
|
|
||||||
docker pull azuracast/azuracast_web_v2:latest
|
|
||||||
docker build --cache-from azuracast/azuracast_web_v2:latest -t azuracast/azuracast_web_v2:latest .
|
|
||||||
|
|
||||||
- name: Clear existing assets and set permissions.
|
- name: Clear existing assets and set permissions.
|
||||||
run: |
|
run: |
|
||||||
rm -rf resources/locale/compiled
|
rm -rf resources/locale/compiled
|
||||||
|
@ -75,25 +53,24 @@ jobs:
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||||
|
|
||||||
- name: Set up test environment.
|
- name: Import locales, build static assets.
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
|
||||||
|
- name: Set up functional test environment.
|
||||||
run: |
|
run: |
|
||||||
|
docker pull azuracast/azuracast_web_v2:latest
|
||||||
|
docker build --cache-from azuracast/azuracast_web_v2:latest -t azuracast/azuracast_web_v2:latest .
|
||||||
|
|
||||||
cp azuracast.sample.env azuracast.env
|
cp azuracast.sample.env azuracast.env
|
||||||
cp docker-compose.sample.yml docker-compose.yml
|
cp docker-compose.sample.yml docker-compose.yml
|
||||||
cp docker-compose.testing.yml docker-compose.override.yml
|
cp docker-compose.testing.yml docker-compose.override.yml
|
||||||
|
|
||||||
docker-compose build web
|
docker-compose build web
|
||||||
|
docker-compose run --rm --user="azuracast" web azuracast_install
|
||||||
|
|
||||||
- name: Import translations into backend.
|
- name: Run functional test suite.
|
||||||
run: |
|
|
||||||
docker-compose run --rm web composer ci-import-locales
|
|
||||||
|
|
||||||
- name: Import translations into frontend.
|
|
||||||
run: |
|
|
||||||
docker-compose -f frontend/docker-compose.yml run --rm --user=root frontend npm run ci
|
|
||||||
|
|
||||||
- name: Run test suite.
|
|
||||||
run: |
|
run: |
|
||||||
chmod 777 tests/_output/
|
chmod 777 tests/_output/
|
||||||
docker-compose run --rm --user="azuracast" web azuracast_install
|
|
||||||
docker-compose run --rm --user="azuracast" web composer dev-test
|
docker-compose run --rm --user="azuracast" web composer dev-test
|
||||||
|
|
||||||
- name: Echo test output directory
|
- name: Echo test output directory
|
||||||
|
|
|
@ -27,7 +27,9 @@ tmp/cache/*---*
|
||||||
/util/package_usage_report*
|
/util/package_usage_report*
|
||||||
|
|
||||||
# Composer-generated content
|
# Composer-generated content
|
||||||
/vendor/
|
/vendor/*
|
||||||
|
/vendor/**/*
|
||||||
|
!/vendor/.gitkeep
|
||||||
|
|
||||||
# Ansible deployment files
|
# Ansible deployment files
|
||||||
/ansible/
|
/ansible/
|
||||||
|
|
|
@ -41,7 +41,7 @@ COPY --chown=azuracast:azuracast . .
|
||||||
RUN composer dump-autoload --optimize --classmap-authoritative \
|
RUN composer dump-autoload --optimize --classmap-authoritative \
|
||||||
&& touch /var/azuracast/.docker
|
&& touch /var/azuracast/.docker
|
||||||
|
|
||||||
VOLUME ["/var/azuracast/www", "/var/azuracast/backups", "/etc/letsencrypt", "/var/azuracast/sftpgo/persist"]
|
VOLUME ["/var/azuracast/www_tmp", "/var/azuracast/backups", "/etc/letsencrypt", "/var/azuracast/sftpgo/persist"]
|
||||||
|
|
||||||
#
|
#
|
||||||
# END Operations as `azuracast` user
|
# END Operations as `azuracast` user
|
||||||
|
|
|
@ -61,7 +61,6 @@ services:
|
||||||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||||
volumes:
|
volumes:
|
||||||
- letsencrypt:/etc/letsencrypt
|
- letsencrypt:/etc/letsencrypt
|
||||||
- www_data:/var/azuracast/www
|
|
||||||
- tmp_data:/var/azuracast/www_tmp
|
- tmp_data:/var/azuracast/www_tmp
|
||||||
- station_data:/var/azuracast/stations
|
- station_data:/var/azuracast/stations
|
||||||
- shoutcast2_install:/var/azuracast/servers/shoutcast2
|
- shoutcast2_install:/var/azuracast/servers/shoutcast2
|
||||||
|
@ -278,6 +277,5 @@ volumes:
|
||||||
sftpgo_data: {}
|
sftpgo_data: {}
|
||||||
station_data: {}
|
station_data: {}
|
||||||
tmp_data: {}
|
tmp_data: {}
|
||||||
www_data: {}
|
|
||||||
redis_data: {}
|
redis_data: {}
|
||||||
backups: {}
|
backups: {}
|
|
@ -0,0 +1 @@
|
||||||
|
keep
|
Loading…
Reference in New Issue