Skip to content

build: Switch to github actions #5

build: Switch to github actions

build: Switch to github actions #5

Workflow file for this run

name: 🏗 Build
on:
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]
push:
branches: [ main ]
permissions:
checks: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
prefer_lowest: ["", "--prefer-lowest"]
container:
image: skpr/php-cli:8.4-dev-v2-latest
options:
--pull always
--user 1001:1001
steps:
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
- name: 📦 Composer Update
run: composer update --with-all-dependencies --prefer-dist --no-progress --no-interaction ${{ matrix.prefer_lowest }}
- name: 🧹 PHPCS
run: ./bin/phpcs --report=checkstyle -q | ./bin/cs2pr
- name: 🧹 PHPStan
run: ./bin/phpstan --error-format=github analyse -v
- name: ➕ Add matcher
run: |
cat << 'EOF' > .github/phpunit-failure.json
{"problemMatcher":[{"owner":"phpunit-failure","severity":"error","pattern":[{"regexp":"##teamcity\\[testFailed[^\\]]*message='([^']*)'[^\\]]*details='/data/([^:]+):(\\d+)","message":1,"file":2,"line":3}]}]}
EOF
echo "::add-matcher::.github/phpunit-failure.json"
- name: ⚡ Run Tests
run: ./bin/phpunit --teamcity
- name: ➖ Remove matcher
if: always()
run: echo "::remove-matcher owner=phpunit-failure::"