概要
プロジェクトでphpunit
の自動化テストをGitHubActionsで自動化したので紹介します
https://phpunit.de/
やり方
.github/workflows/main.yml
name: CodeCheck
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: docker-compose up
run: |
# docker-compose build
docker-compose up -d
- name: composer install
run: |
docker-compose exec -T laravel bash -c "composer install"
- name: phpunit
run: |
docker-compose exec -T laravel bash -c "php vendor/bin/phpunit"