Optimize CI testing and web dependencies (#2899)
This commit is contained in:
parent
31c55a2c0a
commit
f44261b29b
|
@ -8,7 +8,6 @@
|
|||
!resources/locale/compiled
|
||||
!util/docker/web
|
||||
!util/openapi.php
|
||||
!vendor
|
||||
!web
|
||||
!templates
|
||||
!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:
|
||||
- '.github'
|
||||
branches:
|
||||
- ci-testing
|
||||
- master
|
||||
- stable
|
||||
schedule:
|
||||
|
@ -22,35 +23,12 @@ jobs:
|
|||
run: |
|
||||
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
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: vendor
|
||||
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.
|
||||
run: |
|
||||
rm -rf resources/locale/compiled
|
||||
|
@ -75,25 +53,24 @@ jobs:
|
|||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
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: |
|
||||
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 docker-compose.sample.yml docker-compose.yml
|
||||
cp docker-compose.testing.yml docker-compose.override.yml
|
||||
|
||||
docker-compose build web
|
||||
docker-compose run --rm --user="azuracast" web azuracast_install
|
||||
|
||||
- name: Import translations into backend.
|
||||
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.
|
||||
- name: Run functional test suite.
|
||||
run: |
|
||||
chmod 777 tests/_output/
|
||||
docker-compose run --rm --user="azuracast" web azuracast_install
|
||||
docker-compose run --rm --user="azuracast" web composer dev-test
|
||||
|
||||
- name: Echo test output directory
|
||||
|
|
|
@ -27,7 +27,9 @@ tmp/cache/*---*
|
|||
/util/package_usage_report*
|
||||
|
||||
# Composer-generated content
|
||||
/vendor/
|
||||
/vendor/*
|
||||
/vendor/**/*
|
||||
!/vendor/.gitkeep
|
||||
|
||||
# Ansible deployment files
|
||||
/ansible/
|
||||
|
|
|
@ -41,7 +41,7 @@ COPY --chown=azuracast:azuracast . .
|
|||
RUN composer dump-autoload --optimize --classmap-authoritative \
|
||||
&& 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
|
||||
|
|
|
@ -61,7 +61,6 @@ services:
|
|||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||
volumes:
|
||||
- letsencrypt:/etc/letsencrypt
|
||||
- www_data:/var/azuracast/www
|
||||
- tmp_data:/var/azuracast/www_tmp
|
||||
- station_data:/var/azuracast/stations
|
||||
- shoutcast2_install:/var/azuracast/servers/shoutcast2
|
||||
|
@ -278,6 +277,5 @@ volumes:
|
|||
sftpgo_data: {}
|
||||
station_data: {}
|
||||
tmp_data: {}
|
||||
www_data: {}
|
||||
redis_data: {}
|
||||
backups: {}
|
|
@ -0,0 +1 @@
|
|||
keep
|
Loading…
Reference in New Issue