Skip to content

Commit

Permalink
[TM-785] Github workflow to run tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
roguenet committed Apr 9, 2024
1 parent 3af2e8a commit 5818748
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pull-request
on:
pull_request:
branches: [main, staging, release/**]
jobs:
lintTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: make composer
- name: Bring up Docker
run: make up
- name: Lint & Test
run: make test
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ migrate-seed:
migrate-seed-test:
echo "create database if not exists terramatch_test;" | docker-compose exec -T mariadb mysql -h localhost -u root -proot
echo "grant all on terramatch_test.* to 'wri'@'%';" | docker-compose exec -T mariadb mysql -h localhost -u root -proot
docker-compose exec php php artisan --env=testing migrate:fresh
docker-compose exec php php artisan --env=testing migrate-services
docker-compose exec php php artisan --env=testing db:seed
docker-compose exec -T php php artisan --env=testing migrate:fresh
docker-compose exec -T php php artisan --env=testing migrate-services
docker-compose exec -T php php artisan --env=testing db:seed

test: lint migrate-seed-test
docker-compose exec php ./vendor/bin/phpunit
docker-compose exec -T php ./vendor/bin/phpunit

test-single:
docker-compose exec php ./vendor/bin/phpunit --filter $(t)
Expand All @@ -43,7 +43,7 @@ quick-test: lint migrate-seed-test
docker-compose exec php ./vendor/bin/phpunit --exclude=skipPipeline,slow

lint:
docker-compose exec php ./vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no
docker-compose exec -T php ./vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no

lint-fix:
docker-compose exec php ./vendor/bin/php-cs-fixer fix -v
Expand Down

0 comments on commit 5818748

Please sign in to comment.