Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify CI #2

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 18 additions & 46 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,40 @@ on:
jobs:
static-code-analysis:
name: "Static Code Analysis"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- 8.2
dependencies:
- highest
composer-options:
- --with vimeo/psalm:^4
- --with vimeo/psalm:^5
- --with vimeo/psalm:^6

steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
composer-options: ${{ matrix.composer_options }}

- name: "Determine composer cache directory"
id: determine-composer-cache-directory
run: echo "::set-output name=directory::$(composer config cache-dir)"

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: "Install lowest dependencies from composer.json"
if: matrix.dependencies == 'lowest'
run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest

- name: "Install highest dependencies from composer.json"
if: matrix.dependencies == 'highest'
run: composer install --no-interaction --no-progress --no-suggest

- name: "Cache cache directory for vimeo/psalm"
uses: actions/cache@v1
- uses: ramsey/composer-install@v3
with:
path: .build/psalm
key: php-${{ matrix.php-version }}-psalm-${{ github.sha }}
restore-keys: php-${{ matrix.php-version }}-psalm-
dependency-versions: ${{ matrix.dependencies }}

- name: "Run vimeo/psalm"
run: vendor/bin/psalm --find-unused-psalm-suppress --shepherd --show-info=false --stats --output-format=github

tests:
name: "Tests"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-latest"

strategy:
matrix:
Expand All @@ -73,38 +56,27 @@ jobs:
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
dependencies:
- highest
- lowest
include:
- php-version: 7.2
dependencies: lowest

steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}

- name: "Determine composer cache directory"
id: determine-composer-cache-directory
run: echo "::set-output name=directory::$(composer config cache-dir)"

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
- uses: ramsey/composer-install@v3
with:
path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: "Install lowest dependencies from composer.json"
if: matrix.dependencies == 'lowest'
run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest

- name: "Install highest dependencies from composer.json"
if: matrix.dependencies == 'highest'
run: composer install --no-interaction --no-progress --no-suggest
dependency-versions: ${{ matrix.dependencies }}

- name: "Build acceptance tests with codeception"
run: vendor/bin/codecept build
Expand Down
Loading