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 diff --git a/tests/V2/SiteReports/AdminIndexSiteReportsControllerTest.php b/tests/V2/SiteReports/AdminIndexSiteReportsControllerTest.php index 5c97f63f1..cce52210d 100644 --- a/tests/V2/SiteReports/AdminIndexSiteReportsControllerTest.php +++ b/tests/V2/SiteReports/AdminIndexSiteReportsControllerTest.php @@ -18,8 +18,8 @@ class AdminIndexSiteReportsControllerTest extends TestCase public function test_invoke_action() { Artisan::call('v2migration:roles'); - Framework::factory()->create(['slug' => 'terrafund']); - Framework::factory()->create(['slug' => 'ppc']); +// Framework::factory()->create(['slug' => 'terrafund']); +// Framework::factory()->create(['slug' => 'ppc']); $tfAdmin = User::factory()->admin()->create(); $ppcAdmin = User::factory()->admin()->create(); $tfAdmin->givePermissionTo('framework-terrafund');