-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (65 loc) · 2.69 KB
/
phpunit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: PHPUnit
on:
push:
branches: [main]
merge_group:
branches: [main]
pull_request:
jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-22.04
env:
GCNOTIFY_API_KEY: ${{ secrets.GCNOTIFY_API_KEY }}
GCNOTIFY_TEMPLATE_APPLICATION_DEADLINE_APPROACHING_EN: ${{ vars.GCNOTIFY_TEMPLATE_APPLICATION_DEADLINE_APPROACHING_EN }}
GCNOTIFY_TEMPLATE_APPLICATION_DEADLINE_APPROACHING_FR: ${{ vars.GCNOTIFY_TEMPLATE_APPLICATION_DEADLINE_APPROACHING_FR }}
GCNOTIFY_TEMPLATE_APPLICATION_STATUS_CHANGED_EN: ${{ vars.GCNOTIFY_TEMPLATE_APPLICATION_STATUS_CHANGED_EN }}
GCNOTIFY_TEMPLATE_APPLICATION_STATUS_CHANGED_FR: ${{ vars.GCNOTIFY_TEMPLATE_APPLICATION_STATUS_CHANGED_FR }}
GCNOTIFY_TEMPLATE_NEW_JOB_POSTED_EN: ${{ vars.GCNOTIFY_TEMPLATE_NEW_JOB_POSTED_EN }}
GCNOTIFY_TEMPLATE_NEW_JOB_POSTED_FR: ${{ vars.GCNOTIFY_TEMPLATE_NEW_JOB_POSTED_FR }}
GCNOTIFY_TEMPLATE_TALENT_REQUEST_SUBMISSION_CONFIRMATION_ENFR: ${{ vars.GCNOTIFY_TEMPLATE_TALENT_REQUEST_SUBMISSION_CONFIRMATION_ENFR }}
services:
postgres:
image: postgres:12.15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password1234
POSTGRES_DB: gctalent
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Add postgres extension pgcrypto # not included with postgres 12
run: docker run --rm --network ${{ job.container.network }} postgres:12.15 sh -c "PGPASSWORD=password1234 exec psql -h postgres -d gctalent -p 5432 -U postgres -t -c 'CREATE EXTENSION IF NOT EXISTS pgcrypto';"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: bcmath
coverage: pcov
- name: Install api dependencies
working-directory: api
run: |
sudo apt-get install --yes --no-install-recommends postgresql-client
cp .env.example .env
composer install --prefer-dist --no-scripts
- name: PHPUnit tests
working-directory: api
env:
DB_HOST: localhost
run: |
if [ github.actor != 'dependabot[bot]' ]; then
php artisan test --parallel --processes=2 --coverage-clover=coverage.xml
else
php artisan test
fi
- name: Upload coverage report to Codecov
if: github.actor != 'dependabot[bot]'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: integrationtests
fail_ci_if_error: false