Skip to content

Commit e7a91e3

Browse files
author
midesweb
committed
add github actions
1 parent dae5c6d commit e7a91e3

File tree

3 files changed

+72
-1
lines changed

3 files changed

+72
-1
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Create GitHub Release
19+
uses: softprops/action-gh-release@v1
20+
with:
21+
generate_release_notes: true

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php: [8.3]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
25+
- name: Get Composer Cache Directory
26+
id: composer-cache
27+
run: |
28+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
29+
- uses: actions/cache@v4
30+
with:
31+
path: ${{ steps.composer-cache.outputs.dir }}
32+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-composer-
35+
36+
- name: Install Dependencies
37+
run: composer install --prefer-dist --no-progress --no-suggest
38+
39+
- name: Validate composer.json
40+
run: composer validate --strict
41+
42+
- name: Check for security vulnerabilities
43+
run: composer audit
44+
45+
- name: Run PHP CS Fixer check
46+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
47+
48+
- name: Run PHPUnit Tests
49+
run: php -d zend.assertions=1 -d assert.active=1 vendor/bin/phpunit

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
2-
.phpunit.cache
2+
.phpunit.cache
3+
.DS_Store

0 commit comments

Comments
 (0)