-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (69 loc) · 2.31 KB
/
ci.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
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
postgresql:
image: postgis/postgis:14-3.3-alpine
env:
POSTGRES_USER: dialog
POSTGRES_PASSWORD: dialog
POSTGRES_DB: dialog
ports:
- 5432:5432
redis:
image: redis:5-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v1
- uses: nikeee/setup-pandoc@v1
with:
pandoc-version: '3.1.5'
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: actions/cache@v3
with:
path: ~/.cache/node
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys:
${{ runner.os }}-node-
- name: Init CI environment variables
# HACK: Symfony won't read from 'env: { DATABASE_URL: ... }', so we need to edit
# .env directly.
run: |
echo "DATABASE_URL=postgresql://dialog:dialog@localhost:5432/dialog" >> .env
echo "BDTOPO_DATABASE_URL=${{ secrets.BDTOPO_DATABASE_URL }}" >> .env
echo "METABASE_DATABASE_URL=postgresql://dialog:dialog@localhost:5432/dialog" >> .env
echo "REDIS_URL=redis://localhost:6379" >> .env
echo "APP_STORAGE_SOURCE=memory.storage" >> .env
- name: CI
run: make ci CI=1 BIN_SHELL="" BIN_CONSOLE="php bin/console" BIN_COMPOSER="composer"
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-logfile
path: var/log/test.log
retention-days: 7