Merge pull request #139 from asgrim/consolidate-release-pipelines #253
This file contains 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: "Continuous Integration" | |
on: | |
pull_request: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
unit-tests: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: | |
- ubuntu-latest | |
- windows-latest | |
php-versions: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
- '8.4' | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: intl, sodium, zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
# temporarily remove Psalm until ready for PHP 8.4 | |
- name: remove psalm | |
if: matrix.php-versions == '8.4' | |
run: composer remove --dev --no-install vimeo/psalm psalm/plugin-phpunit php-standard-library/psalm-plugin | |
- uses: ramsey/composer-install@v3 | |
- name: Run PHPUnit on Windows | |
if: matrix.operating-system == 'windows-latest' | |
run: vendor/bin/phpunit | |
- name: Run PHPUnit on non-Windows | |
if: matrix.operating-system != 'windows-latest' | |
run: sudo vendor/bin/phpunit | |
behaviour-tests: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: | |
- ubuntu-latest | |
- windows-latest | |
php-versions: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
- '8.4' | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: intl, sodium, zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
# temporarily remove Psalm until ready for PHP 8.4 | |
- name: remove psalm | |
if: matrix.php-versions == '8.4' | |
run: composer remove --dev --no-install vimeo/psalm psalm/plugin-phpunit php-standard-library/psalm-plugin | |
- uses: ramsey/composer-install@v3 | |
- name: Run Behat on Windows | |
if: matrix.operating-system == 'windows-latest' | |
run: vendor/bin/behat --tags="~@non-windows" | |
- name: Run Behat on non-Windows | |
if: matrix.operating-system != 'windows-latest' | |
run: vendor/bin/behat | |
coding-standards: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
extensions: intl, sodium, zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
- uses: ramsey/composer-install@v3 | |
- name: Run PHPCS | |
run: vendor/bin/phpcs | |
static-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
extensions: intl, sodium, zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
- uses: ramsey/composer-install@v3 | |
- name: Run Psalm | |
run: vendor/bin/psalm | |
build-phar: | |
needs: | |
- unit-tests | |
- coding-standards | |
- static-analysis | |
# See build-phar.yml for a list of the permissions and why they are needed | |
permissions: | |
contents: read | |
id-token: write | |
attestations: write | |
uses: ./.github/workflows/build-phar.yml |