From af4b39e9f337e18b66a5280f48c46298f4191a7c Mon Sep 17 00:00:00 2001 From: James Seconde Date: Mon, 23 Oct 2023 17:07:21 +0100 Subject: [PATCH] build script to run on release, update for changelogs another time --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 145da285..2197a6f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,15 +19,49 @@ permissions: statuses: write jobs: - add-changelog: - name: Add Changelog + build: runs-on: ubuntu-latest + strategy: + matrix: + php: [ '8.0', '8.1', '8.2' ] + + name: PHP ${{ matrix.php }} Test steps: - - name: Add Changelog - uses: nexmo/github-actions/nexmo-changelog@main + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, mbstring + coverage: pcov env: - CHANGELOG_AUTH_TOKEN: ${{ secrets.CHANGELOG_AUTH_TOKEN }} - CHANGELOG_CATEGORY: Server SDK - CHANGELOG_RELEASE_TITLE: vonage-php-sdk-core - CHANGELOG_SUBCATEGORY: php + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Get Composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache Composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer update --prefer-dist --no-interaction + + - name: Analyze & test + run: composer test -- -v --coverage-clover=coverage.xml + + - name: Run PHPStan + run: ./vendor/bin/phpstan + + - name: Run codecov + uses: codecov/codecov-action@v1