✨ [GEST-1928] Rodando em self-hosted runner #18
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
matrix: | |
PHP: [56, 73, 74, 80, 81] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Prepare code | |
env: | |
PHP_VERSION: ${{ matrix.PHP }} | |
run: | | |
touch .env | |
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env | |
echo "PHP_VERSION=$PHP_VERSION" >> .env | |
- name: Up environment | |
run: | | |
docker compose up -d | |
- name: Wait environment | |
run: | | |
echo $(docker compose -f docker-compose.wait.yml run --rm wait) | |
- name: Environment logs | |
run: | | |
docker compose ps | |
docker compose logs php | |
- name: Install PHP Stan | |
if: matrix.PHP != '56' | |
run: | | |
docker compose exec -T php composer require phpstan/phpstan --dev | |
- name: Run PHP Unit | |
run: | | |
docker compose exec -T php composer test | |
- name: Run PHP Stan | |
if: matrix.PHP != '56' | |
run: | | |
docker compose exec -T php composer analyse | |
- name: Run PHP CS Fixer | |
if: matrix.PHP != '56' | |
run: | | |
docker compose exec -T php composer fix:ci | |
- name: Desligando ambiente | |
if: ${{ always() }} | |
run: | | |
docker compose exec -T php rm -Rf vendor/ .env | |
docker compose down --remove-orphans |