Merge branch 'dev-4' of github.com:baserproject/basercms into dev-4 #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# test.yml | |
# | |
# コンテナ起動時に、composer install を実行するが、Github Actions では、非同期で処理が走るため | |
# composer の処理が完了する前にテストが行われてしまい、テストが失敗する。 | |
# そのため、composer install を同期処理とするため、ジョブの steps に composer の処理を追加している | |
# | |
name: Test | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
name: Unit Test | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
php-version: ['7.4'] | |
steps: | |
- name: Setup PHP 7.4 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.4 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Run compose | |
run: | | |
cd docker | |
cp docker-compose.yml.default docker-compose.yml | |
docker-compose up -d | |
- name: Sleep for 20 seconds | |
run: sleep 20 | |
- name: Compose log | |
run: | | |
cd docker | |
docker-compose logs | |
- name: Run test suite | |
run: | | |
docker exec bc-php composer run-script install | |
docker exec bc-php composer run-script test |