.github/workflows/Build.yml
name: Build
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-20.04
strategy:
matrix:
php: [8.0]
steps:
- uses: actions/checkout@master
- name: Checkout
if: github.ref == 'refs/heads/master'
run: git checkout "${GITHUB_REF:11}"
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Composer Install
run: composer install
- name: PHPCS
run: ./vendor/bin/phpcs src tests
- name: Run Tests
run: ./vendor/bin/phpunit
- name: Coveralls
if: github.ref == 'refs/heads/master'
run: ./vendor/bin/php-coveralls -v --coverage_clover build/coverage.xml --json_path build/coveralls-upload.json
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
if: github.ref == 'refs/heads/master'
needs: test
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install dependencies
run: yarn install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release@15