From 5818748007b2169543e128f5222d3650d9dfc05a Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Tue, 9 Apr 2024 11:03:38 -0700 Subject: [PATCH] [TM-785] Github workflow to run tests. --- .github/workflows/pull-request.yml | 15 +++++++++++++++ Makefile | 10 +++++----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000..d7b52b16e --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -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 diff --git a/Makefile b/Makefile index 16c33bf88..0fdfff1ff 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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