Skip to content

Commit

Permalink
ci: Simplify things.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 23, 2022
1 parent 6147f9c commit 1ef0edc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 66 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
on:
push:
paths:
- "src/**.php"
- "tests/**.php"
- "**.php"
branches:
- master
pull_request:
paths:
- "src/**.php"
- "tests/**.php"
- "**.php"

name: "Code style"

Expand All @@ -22,7 +20,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4", "8.1"]
php-versions: ["8.1"]

steps:
- name: Set git to use LF
Expand All @@ -32,29 +30,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@2.21.1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: gd,mbstring,pcov
tools: cs2pr

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
uses: ramsey/composer-install@v2

- name: Run Grumphp
run: vendor/bin/grumphp run --testsuite=cs -n
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@2.21.1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
extensions: gd,mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
uses: ramsey/composer-install@v2

- name: Run Grumphp
env:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Determine tag
id: tag_name
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
on:
push:
paths:
- "src/**.php"
- "tests/**.php"
- "**.php"
branches:
- master
pull_request:
paths:
- "src/**.php"
- "tests/**.php"
- "**.php"

name: "Static analysis"

Expand All @@ -22,7 +20,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4", "8.1"]
php-versions: ["8.1"]

steps:
- name: Set git to use LF
Expand All @@ -32,30 +30,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@2.21.1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: none
tools: cs2pr

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
uses: ramsey/composer-install@v2

- name: Run Grumphp
run: vendor/bin/grumphp run --tasks=psalm,phpstan -n
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
on:
push:
paths:
- "src/**.php"
- "tests/**.php"
- "**.php"
branches:
- master
pull_request:
paths:
- "src/**.php"
- "tests/**.php"
- "**.php"

name: "Unit tests"

Expand Down Expand Up @@ -42,11 +40,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Install PHP
uses: shivammathur/setup-php@2.21.1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
Expand All @@ -56,8 +52,6 @@ jobs:
uses: ramsey/composer-install@v2

- name: Run Grumphp
env:
XDEBUG_MODE: coverage
run: vendor/bin/grumphp run --tasks=phpunit,clover_coverage

- name: Send Scrutinizer data
Expand Down

0 comments on commit 1ef0edc

Please sign in to comment.