-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9089aba
commit 1fc7042
Showing
3 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Test Application (PostgreSQL) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Test Application (with PostgreSQL) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['7.3', '7.4', '8.0', '8.1', '8.2'] | ||
|
||
env: | ||
DB_CONNECTION: testing_pgsql | ||
|
||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_USER: freescout-test | ||
POSTGRES_PASSWORD: freescout-test | ||
POSTGRES_DB: freescout-test | ||
ports: | ||
- 5432/tcp | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: pgsql, mbstring, xml, imap, zip, gd, curl, intl, json | ||
|
||
- name: Install composer dependencies | ||
run: composer install --ignore-platform-reqs --no-interaction | ||
|
||
- name: Migrate and seed the database | ||
run: | | ||
php${{ matrix.php }} artisan migrate --force -n --database=testing | ||
php${{ matrix.php }} artisan db:seed --force -n --database=testing | ||
env: | ||
DB_PORT: ${{ job.services.postgres.ports[5432] }} | ||
|
||
- name: Run PHP tests | ||
run: php${{ matrix.php }} ./vendor/bin/phpunit | ||
env: | ||
DB_PORT: ${{ job.services.postgres.ports[5432] }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters