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 9d85f0f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pull-request
on: pull_request
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
4 changes: 2 additions & 2 deletions tests/V2/SiteReports/AdminIndexSiteReportsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 9d85f0f

Please sign in to comment.