Release version 1.0.0 #1
This file contains hidden or 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/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-version: ['8.2', '8.3'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo | |
| coverage: xdebug | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run PHPStan | |
| run: composer stan | |
| - name: Run tests | |
| run: composer test | |
| - name: Generate coverage report | |
| run: ./vendor/bin/phpunit --coverage-clover coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run security audit | |
| run: composer audit | |
| release: | |
| name: Release to Packagist | |
| runs-on: ubuntu-latest | |
| needs: [test, security] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Validate composer.json | |
| run: composer validate --strict | |
| - name: Notify Packagist | |
| run: | | |
| curl -XPOST \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"repository\":\"https://github.com/FastPix/fastpix-php\"}" \ | |
| https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USERNAME }}&apiToken=${{ secrets.PACKAGIST_TOKEN }} | |
| - name: Create GitHub Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| body: | | |
| ## FastPix PHP SDK ${{ github.ref }} | |
| This release includes: | |
| - Complete API coverage (100% of OpenAPI spec) | |
| - Production-ready code quality | |
| - Comprehensive documentation | |
| - Full test suite | |
| See [CHANGELOG.md](CHANGELOG.md) for detailed changes. | |
| draft: false | |
| prerelease: false |