name: build
on: [ push ]
jobs:
build-test:
runs-on: ubuntu-20.04
container: docker.io/crowphp/php:8.0-cli-buster-xdebug
steps:
- uses: actions/checkout@v2
- name: Install composer dependencies
run: composer install --dev
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Extract crowphp absolute path
run: CROWPHP_PATH=$(pwd)
- name: Run PHP code sniffer
run: composer phpcs
- name: Run PHP static analysis
run: composer phpstan
- name: Run PHPUnit
run: composer phpunit
- name: Create coverage badge
run: |
php vendor/bin/badger upload:coverage $BADGER_SERVER $BRANCH_NAME $BADGER_SECRET_KEY
env:
BADGER_SECRET_KEY: ${{ secrets.BADGER_SECRET_KEY }}
BADGER_SERVER: ${{ secrets.BADGER_SERVER }}
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
|