main #1293
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
name: main | |
on: | |
pull_request: | |
push: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: [7.2, 7.3, 7.4] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, dom, zip | |
coverage: xdebug | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: generate zengin-data | |
run: php bin/generate-data | |
- name: composer install | |
run: composer install --no-interaction --no-ansi --no-progress --no-suggest | |
- name: run phpunit | |
run: vendor/bin/phpunit --coverage-clover coverage.xml | |
- name: run phpcs | |
run: composer cs | |
- name: upload coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build-deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: [ 7.4 ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, dom, zip | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: generate zengin-data | |
run: echo "UPDATE_STATUS=$(php bin/generate-data)" >> $GITHUB_ENV | |
- name: deploy | |
if: env.UPDATE_STATUS == 'update' | |
run: php bin/commit-tag | |
- name: check | |
run: git status | |
- name: Push changes | |
if: env.UPDATE_STATUS == 'update' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tags: true |