Skip to content

Commit d4cc8d0

Browse files
committed
Add CI actions in compiler
1 parent f18a157 commit d4cc8d0

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
name: Tests (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.4' ]
15+
os: [ ubuntu-latest, macos-latest, windows-latest ]
16+
stability: [ prefer-lowest, prefer-stable ]
17+
steps:
18+
- name: Set Git To Use LF
19+
run: |
20+
git config --global core.autocrlf false
21+
git config --global core.eol lf
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Setup PHP ${{ matrix.php }}
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
tools: pecl
29+
ini-values: "memory_limit=-1"
30+
- name: Validate Composer
31+
run: composer validate
32+
- name: Get Composer Cache Directory
33+
id: composer-cache
34+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
35+
- name: Restore Composer Cache
36+
uses: actions/cache@v3
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
41+
- name: Install Dependencies
42+
uses: nick-invision/retry@v2
43+
with:
44+
timeout_minutes: 5
45+
max_attempts: 5
46+
command: composer update --${{ matrix.stability }} --ignore-platform-reqs --prefer-dist --no-interaction --no-progress
47+
- name: Execute Tests
48+
run: php vendor/bin/phpunit

0 commit comments

Comments
 (0)