Skip to content

Commit eada8ca

Browse files
committed
simplify actions
1 parent 0ba6c2b commit eada8ca

2 files changed

Lines changed: 8 additions & 114 deletions

File tree

src/valksor-plugin/.github/workflows/valksor_plugin.yml

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ on:
55
pull_request:
66

77
jobs:
8-
tests:
9-
name: Tests on PHP ${{ matrix.php-version }}
10-
runs-on: ubuntu-latest
11-
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
php-version: [ '8.4', '8.5', '8.6' ]
8+
upload-codecov:
9+
name: Upload coverage to Codecov
10+
runs-on: self-arm
1611

1712
steps:
1813
# https://github.com/marketplace/actions/checkout
@@ -21,46 +16,8 @@ jobs:
2116
with:
2217
fetch-depth: 0
2318

24-
# https://github.com/marketplace/actions/setup-php-action
25-
- name: Setup PHP
26-
uses: shivammathur/setup-php@v2
27-
with:
28-
php-version: ${{ matrix.php-version }}
29-
extensions: mbstring, xml, json, iconv, dom, simplexml, tokenizer
30-
tools: composer:v2
31-
coverage: pcov
32-
33-
# https://github.com/marketplace/actions/cache
34-
- name: Cache Composer dependencies
35-
uses: actions/cache@v4
36-
with:
37-
path: |
38-
~/.composer/cache
39-
vendor/
40-
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
41-
restore-keys: |
42-
${{ runner.os }}-composer-${{ matrix.php-version }}-
43-
44-
- name: Validate composer.json and composer.lock
45-
run: composer validate
46-
47-
- name: Install Composer dependencies
48-
run: composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
49-
50-
- name: Check for security advisories
51-
run: |
52-
if composer audit --no-dev --locked; then
53-
echo "✅ No security vulnerabilities found in production dependencies"
54-
else
55-
echo "❌ Security vulnerabilities found!"
56-
exit 1
57-
fi
58-
59-
- name: Run tests with PHPUnit
60-
run: php -d xdebug.mode=coverage vendor/bin/phpunit
61-
19+
# https://github.com/marketplace/actions/codecov
6220
- name: Upload coverage to Codecov
63-
if: matrix.php-version == '8.5'
6421
uses: codecov/codecov-action@v5
6522
env:
6623
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -70,17 +27,7 @@ jobs:
7027
verbose: true
7128

7229
- name: Upload test results to Codecov
73-
if: matrix.php-version == '8.5' && !cancelled()
7430
uses: codecov/test-results-action@v1
7531
with:
7632
token: ${{ secrets.CODECOV_TOKEN }}
7733
files: .coverage/junit.xml
78-
79-
- name: Upload coverage reports to GitHub
80-
uses: actions/upload-artifact@v5
81-
if: always()
82-
with:
83-
name: coverage-report-php-${{ matrix.php-version }}
84-
path: |
85-
.coverage/clover.xml
86-
retention-days: 1

src/valksor/.github/workflows/valksor.yml

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ on:
55
pull_request:
66

77
jobs:
8-
tests:
9-
name: Tests on PHP ${{ matrix.php-version }}
10-
runs-on: ubuntu-latest
11-
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
php-version: [ '8.4', '8.5', '8.6' ]
8+
upload-codecov:
9+
name: Upload coverage to Codecov
10+
runs-on: self-arm
1611

1712
steps:
1813
# https://github.com/marketplace/actions/checkout
@@ -21,46 +16,8 @@ jobs:
2116
with:
2217
fetch-depth: 0
2318

24-
# https://github.com/marketplace/actions/setup-php-action
25-
- name: Setup PHP
26-
uses: shivammathur/setup-php@v2
27-
with:
28-
php-version: ${{ matrix.php-version }}
29-
extensions: mbstring, xml, json, iconv, dom, simplexml, tokenizer, random, curl, xmlreader, gmp
30-
tools: composer:v2
31-
coverage: pcov
32-
33-
# https://github.com/marketplace/actions/cache
34-
- name: Cache Composer dependencies
35-
uses: actions/cache@v4
36-
with:
37-
path: |
38-
~/.composer/cache
39-
vendor/
40-
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
41-
restore-keys: |
42-
${{ runner.os }}-composer-${{ matrix.php-version }}-
43-
44-
- name: Validate composer.json and composer.lock
45-
run: composer validate
46-
47-
- name: Install Composer dependencies
48-
run: composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
49-
50-
- name: Check for security advisories
51-
run: |
52-
if composer audit --no-dev --locked; then
53-
echo "✅ No security vulnerabilities found in production dependencies"
54-
else
55-
echo "❌ Security vulnerabilities found!"
56-
exit 1
57-
fi
58-
59-
- name: Run tests with PHPUnit
60-
run: php -d xdebug.mode=coverage vendor/bin/phpunit
61-
19+
# https://github.com/marketplace/actions/codecov
6220
- name: Upload coverage to Codecov
63-
if: matrix.php-version == '8.5'
6421
uses: codecov/codecov-action@v5
6522
env:
6623
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -70,17 +27,7 @@ jobs:
7027
verbose: true
7128

7229
- name: Upload test results to Codecov
73-
if: matrix.php-version == '8.5' && !cancelled()
7430
uses: codecov/test-results-action@v1
7531
with:
7632
token: ${{ secrets.CODECOV_TOKEN }}
7733
files: .coverage/junit.xml
78-
79-
- name: Upload coverage reports to GitHub
80-
uses: actions/upload-artifact@v5
81-
if: always()
82-
with:
83-
name: coverage-report-php-${{ matrix.php-version }}
84-
path: |
85-
.coverage/clover.xml
86-
retention-days: 1

0 commit comments

Comments
 (0)