Skip to content

Commit

Permalink
Merge pull request #37 from utopia-php/feat-github-action
Browse files Browse the repository at this point in the history
move tests to github action
  • Loading branch information
eldadfux authored Apr 8, 2024
2 parents bf07f60 + 9a50ab7 commit e3bb652
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 108 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "CodeQL"

on: [pull_request]
jobs:
lint:
name: CodeQL
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- run: git checkout HEAD^2

- name: Run CodeQL
run: |
docker run --rm -v $PWD:/app composer sh -c \
"composer install --profile --ignore-platform-reqs && composer check"
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Tests"

on: [pull_request]
jobs:
lint:
name: Tests ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3', 'nightly']

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Compose install
run: composer install --ignore-platform-reqs

- name: Run tests
run: |
export OPENSRS_KEY=${{ secrets.OPENSRS_KEY }}
export OPENSRS_USERNAME=${{ secrets.OPENSRS_USERNAME }}
composer test
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
"scripts": {
"test": "vendor/bin/phpunit",
"lint": "./vendor/bin/pint --test",
"format": "./vendor/bin/pint"
"format": "./vendor/bin/pint",
"check": "./vendor/bin/phpstan analyse --level 4 src tests"
},
"require": {
"php": ">=8.0",
"utopia-php/framework": "0.*.*"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"laravel/pint": "1.2.*"
"laravel/pint": "1.2.*",
"phpstan/phpstan": "1.9.x-dev"
},
"minimum-stability": "dev"
}
Loading

0 comments on commit e3bb652

Please sign in to comment.