-
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·70 lines (54 loc) · 1.76 KB
/
continuous-integration.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
name: tests
on: [push, pull_request]
jobs:
release:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:14-bullseye
env:
POSTGRES_USER: test
POSTGRES_DB: test
POSTGRES_PASSWORD: test
ports:
- 5433:5432
steps:
- name: Install packages
run: sudo apt-get install bash gzip tar wget
- name: Checkout project
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2.5
- name: Cache composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Add HTTP basic auth credentials
run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json
- name: Install dependencies
run: composer install --prefer-dist
- name: Remove auth.json file
run: rm -f $GITHUB_WORKSPACE/auth.json
- name: Copy test environment variables configuration file
run: |
cp $GITHUB_WORKSPACE/.env.test.dist $GITHUB_WORKSPACE/.env.test
cat $GITHUB_WORKSPACE/.env.test
- name: Clear cache
run: php bin/console cache:clear -e test
- name: Warm-up cache
run: php bin/console cache:warmup -e test
- name: Create test database schema
run: php bin/console doctrine:schema:create -n -e test
- name: Run unit tests
run: make test