Skip to content

Commit

Permalink
ci: Added automatic tests on push
Browse files Browse the repository at this point in the history
  • Loading branch information
maicol07 committed Mar 19, 2024
1 parent 7f2e2b3 commit 83bad0b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
push:

jobs:
tests:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
php-versions: [ '7.3', '7.4', '8.1', '8.2', '8.3' ]
phpunit-versions: [ 'latest' ]
include:
- operating-system: 'ubuntu-latest'
php-versions: '8.0'
phpunit-versions: 9
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, json
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
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 --prefer-dist

- name: Run tests
run: composer test
env:
FLARUM_USERNAME: ${{ secrets.FLARUM_USERNAME }}
FLARUM_PASSWORD: ${{ secrets.FLARUM_PASSWORD }}
4 changes: 4 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@
"support": {
"issues": "https://github.com/maicol07/flarum-api-client/issues",
"source": "https://github.com/maicol07/flarum-api-client"
},
"scripts": {
"test": "phpunit --configuration phpunit.xml tests"
}
}

0 comments on commit 83bad0b

Please sign in to comment.