123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- name: CI
- on: [push, pull_request]
- jobs:
- dotenv_lint:
- name: Dotenv Lint
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Run dotenv-linter
- uses: dotenv-linter/action-dotenv-linter@v2
- with:
- github_token: ${{ secrets.github_token }}
- dotenv_linter_flags: --skip UnorderedKey
- markdown_lint:
- name: Markdown Lint
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Run markdownlint
- uses: docker://avtodev/markdown-lint:v1
- with:
- args: './README.md'
- phpcs:
- name: PHPCS
- runs-on: ubuntu-latest
- container:
- image: baijunyao/php:8.0-local
- volumes:
- - /__w/laravel-bjyblog/laravel-bjyblog:/app
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Get Composer Cache Directory
- id: composer-cache
- run: |
- echo "::set-output name=dir::$(composer config cache-files-dir)"
- - uses: actions/cache@v1
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
- - name: Initial
- run: |
- cp .env.actions .env
- composer install
- - name: PHP CS Fixer
- run: |
- ./vendor/bin/php-cs-fixer fix --verbose --show-progress=dots --dry-run --diff
- phpstan:
- name: PHPStan
- runs-on: ubuntu-latest
- container:
- image: baijunyao/php:8.0-local
- volumes:
- - /__w/laravel-bjyblog/laravel-bjyblog:/app
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Get Composer Cache Directory
- id: composer-cache
- run: |
- echo "::set-output name=dir::$(composer config cache-files-dir)"
- - uses: actions/cache@v1
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
- - name: Initial
- run: |
- cp .env.actions .env
- composer install
- - name: PHPStan
- run: |
- ./vendor/bin/phpstan analyse --ansi
- helm_lint:
- name: Helm Lint
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up Helm
- uses: azure/setup-helm@v1
- - name: Run Helm lint
- run: |
- cd deploy/helm
- helm lint
- ansible_lint:
- name: Ansible Lint
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Run Ansible lint
- run: |
- pip3 install ansible
- pip3 install ansible-lint
- GITHUB_ACTIONS=true; ansible-lint -p deploy/ansible
- php_8_0_mysql_5_6:
- name: PHP8.0+MySQL5.6
- runs-on: ubuntu-latest
- services:
- mysql:
- image: mysql:5.6
- env:
- MYSQL_ROOT_PASSWORD: laravel_bjyblog
- MYSQL_DATABASE: laravel_bjyblog
- container:
- image: baijunyao/php:8.0-local
- volumes:
- - /__w/laravel-bjyblog/laravel-bjyblog:/app
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Get Composer Cache Directory
- id: composer-cache
- run: |
- echo "::set-output name=dir::$(composer config cache-files-dir)"
- - uses: actions/cache@v1
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
- - name: Initial
- run: |
- cp .env.actions .env
- composer install
- php artisan key:generate
- php artisan passport:keys
- php artisan migrate
- php artisan db:seed
- php artisan storage:link --relative
- - name: Test
- run: |
- composer test
- php_8_0_mysql_5_7:
- name: PHP8.0+MySQL5.7
- runs-on: ubuntu-latest
- services:
- mysql:
- image: mysql:5.7
- env:
- MYSQL_ROOT_PASSWORD: laravel_bjyblog
- MYSQL_DATABASE: laravel_bjyblog
- container:
- image: baijunyao/php:8.0-local
- volumes:
- - /__w/laravel-bjyblog/laravel-bjyblog:/app
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Get Composer Cache Directory
- id: composer-cache
- run: |
- echo "::set-output name=dir::$(composer config cache-files-dir)"
- - uses: actions/cache@v1
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
- - name: Initial
- run: |
- cp .env.actions .env
- composer install
- php artisan key:generate
- php artisan passport:keys
- php artisan migrate
- php artisan db:seed
- php artisan storage:link --relative
- - name: Test
- run: |
- composer test
- php_8_0_mysql_8_0:
- name: PHP8.0+MySQL8.0
- runs-on: ubuntu-latest
- services:
- mysql:
- image: baijunyao/mysql:8.0
- env:
- MYSQL_ROOT_PASSWORD: laravel_bjyblog
- MYSQL_DATABASE: laravel_bjyblog
- container:
- image: baijunyao/php:8.0-local
- volumes:
- - /__w/laravel-bjyblog/laravel-bjyblog:/app
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Get Composer Cache Directory
- id: composer-cache
- run: |
- echo "::set-output name=dir::$(composer config cache-files-dir)"
- - uses: actions/cache@v1
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
- - name: Initial
- run: |
- cp .env.actions .env
- composer install
- php artisan key:generate
- php artisan passport:keys
- php artisan migrate
- php artisan db:seed
- php artisan storage:link --relative
- - name: Test
- run: |
- composer test:coverage-xml
- - name: Upload coverage to Codecov
- uses: codecov/codecov-action@v1
- with:
- files: storage/framework/testing/coverage.xml
- notify:
- name: Slack Notify
- runs-on: ubuntu-latest
- needs: [phpcs, phpstan, helm_lint, ansible_lint, php_8_0_mysql_5_6, php_8_0_mysql_5_7, php_8_0_mysql_8_0,]
- if: always()
- steps:
- - name: Slack Notify
- uses: baijunyao/action-slack-notify@v3.0.0
- if: ${{ github.event_name == 'push' }}
- with:
- slack_channel_id: CEWJP77BP
- slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
- github_context: ${{ toJson(github) }}
|