-
Notifications
You must be signed in to change notification settings - Fork 31
101 lines (77 loc) · 3.72 KB
/
specs.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: SPECS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
SYMFONY_ENV: 'dev'
DATABASE_URL: 'sqlite:///%kernel.project_dir%/var/specs.db'
jobs:
build:
runs-on: ubuntu-latest
steps:
# —— Setup GitHub actions —————————————————————————————————————————————
# https://github.com/actions/checkout (official)
-
name: Checkout
uses: actions/checkout@v2
# —— Setup Environment —————————————————————————————————————————————
# https://github.com/shivammathur/setup-php (community)
-
name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, sqlite, json, simplexml
tools: composer:v2, symfony
ini-values: date.timezone=Europe/Paris
coverage: none
env:
update: true
# https://github.com/actions/setup-node (community)
-
name: Setup Node.js with actions/setup-node
uses: actions/setup-node@v2
with:
node-version: 16
# —— Composer —————————————————————————————————————————————————————————
-
name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
-
name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
-
name: Install Composer dependencies
run: composer install --no-progress --ansi --prefer-dist --optimize-autoloader --no-interaction
## —— Prepare Environment ——————————————————————————————————————————————
-
name: Generate RSA keys needed for authentication
run: |
openssl genrsa -out config/jwt/private.pem -aes256 -passout pass:passphrase 4096
openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem -passin pass:passphrase
-
name: Prepare database
run: |
bin/console doctrine:database:create
bin/console doctrine:schema:create
-
name: Symfony warmup
run: |
bin/console cache:clear --env=dev
## —— Run SPECS ——————————————————————————————————————————————
-
name: Launch PHP server
run: symfony local:server:start --no-tls -d
-
name: Run specs tests
run: APIURL=http://127.0.0.1:8000/api ./spec/api-spec-test-runner.sh
-
name: Stop PHP server
run: symfony local:server:stop