Skip to content

Commit 83bad0b

Browse files
committed
ci: Added automatic tests on push
1 parent 7f2e2b3 commit 83bad0b

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
push:
3+
4+
jobs:
5+
tests:
6+
runs-on: ${{ matrix.operating-system }}
7+
strategy:
8+
matrix:
9+
operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
10+
php-versions: [ '7.3', '7.4', '8.1', '8.2', '8.3' ]
11+
phpunit-versions: [ 'latest' ]
12+
include:
13+
- operating-system: 'ubuntu-latest'
14+
php-versions: '8.0'
15+
phpunit-versions: 9
16+
steps:
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php-versions }}
21+
extensions: mbstring, intl, json
22+
ini-values: post_max_size=256M, max_execution_time=180
23+
coverage: xdebug
24+
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- name: Get composer cache directory
30+
id: composer-cache
31+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
32+
33+
- name: Cache dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: ${{ steps.composer-cache.outputs.dir }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
38+
restore-keys: ${{ runner.os }}-composer-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist
42+
43+
- name: Run tests
44+
run: composer test
45+
env:
46+
FLARUM_USERNAME: ${{ secrets.FLARUM_USERNAME }}
47+
FLARUM_PASSWORD: ${{ secrets.FLARUM_PASSWORD }}

.idea/vcs.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,8 @@
5050
"support": {
5151
"issues": "https://github.com/maicol07/flarum-api-client/issues",
5252
"source": "https://github.com/maicol07/flarum-api-client"
53+
},
54+
"scripts": {
55+
"test": "phpunit --configuration phpunit.xml tests"
5356
}
5457
}

0 commit comments

Comments
 (0)