|
| 1 | +# This action is used for Vortex maintenance. It will not be used in the scaffolded project. |
| 2 | +name: Vortex - Test tooling |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - develop |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - develop |
| 11 | + - 'feature/**' |
| 12 | + - 'bugfix/**' |
| 13 | + |
| 14 | +jobs: |
| 15 | + vortex-test-tooling: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + php-versions: ['8.3', '8.4', '8.5'] |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 |
| 25 | + |
| 26 | + - name: Setup PHP |
| 27 | + uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2 |
| 28 | + with: |
| 29 | + php-version: ${{ matrix.php-versions }} |
| 30 | + coverage: pcov |
| 31 | + ini-values: pcov.directory=. |
| 32 | + |
| 33 | + - name: Setup Node.js |
| 34 | + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 |
| 35 | + with: |
| 36 | + node-version: 22.17.1 |
| 37 | + |
| 38 | + - name: Set default branch name |
| 39 | + run: git config --global init.defaultBranch >/dev/null || git config --global init.defaultBranch "main" |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + run: composer install |
| 43 | + working-directory: .vortex/tooling |
| 44 | + |
| 45 | + - name: Validate Composer configuration is normalized |
| 46 | + run: composer normalize --dry-run |
| 47 | + working-directory: .vortex/tooling |
| 48 | + |
| 49 | + - name: Check coding standards |
| 50 | + run: composer lint |
| 51 | + working-directory: .vortex/tooling |
| 52 | + |
| 53 | + - name: Run tests |
| 54 | + run: composer test-coverage |
| 55 | + working-directory: .vortex/tooling |
| 56 | + env: |
| 57 | + GITHUB_TOKEN: ${{ secrets.PACKAGE_TOKEN }} |
| 58 | + |
| 59 | + - name: Run playground scripts |
| 60 | + run: | |
| 61 | + echo "Running playground scripts for manual verification..." |
| 62 | + cd playground |
| 63 | + for script in *.php; do |
| 64 | + if [ -f "$script" ]; then |
| 65 | + echo "" |
| 66 | + echo "========================================" |
| 67 | + echo "Running: $script" |
| 68 | + echo "========================================" |
| 69 | + if [[ "$script" == *"request"* ]]; then |
| 70 | + # Network-dependent scripts, allow failure |
| 71 | + ./"$script" || echo "⚠️ $script failed (network required)" |
| 72 | + else |
| 73 | + # All other scripts should succeed |
| 74 | + ./"$script" |
| 75 | + fi |
| 76 | + echo "" |
| 77 | + fi |
| 78 | + done |
| 79 | + working-directory: .vortex/tooling |
| 80 | + |
| 81 | + - name: Upload coverage reports as an artifact |
| 82 | + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 |
| 83 | + with: |
| 84 | + name: ${{github.job}}-code-coverage-report-${{ matrix.php-versions }} |
| 85 | + path: .vortex/tooling/.logs |
| 86 | + include-hidden-files: true |
| 87 | + if-no-files-found: error |
| 88 | + |
| 89 | + - name: Upload coverage report to Codecov |
| 90 | + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 |
| 91 | + with: |
| 92 | + files: .vortex/tooling/.logs/cobertura.xml |
| 93 | + fail_ci_if_error: true |
| 94 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments