-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (62 loc) · 2 KB
/
backend-tests.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
name: "Backend Tests"
on:
push: ~
pull_request: ~
schedule:
- cron: "0 0 1 * *"
jobs:
backend:
runs-on: "ubuntu-18.04"
strategy:
matrix:
php-versions: ['7.4']
steps:
- uses: "actions/[email protected]"
- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
with:
path: "~/.composer/cache"
key: "composer-${{ matrix.php-version }}-${{ hashFiles('composer.json') }}"
restore-keys: "composer-${{ matrix.php-version }}-"
- name: "Setup PHP Action"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-versions }}"
extensions: "intl, xdebug, imagick, apcu"
- name: "Install SSH key"
uses: "shimataro/ssh-key-action@v2"
with:
key: "${{ secrets.SSH_KEY_CI }}"
name: "id_rsa"
known_hosts: "${{ secrets.SSH_KNOWN_HOST_AKENEO_EE }}"
# Install / Prepare
- name: "Add EE Composer repository"
run: "composer -n config repositories.ee vcs ${{ secrets.SSH_AKENEO_EE_REPOSITORY }}"
- name: "Install PHP dependencies"
run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
# CI
- name: "PHPSpec"
run: "vendor/bin/phpspec run"
- name: "Integration tests"
run: "vendor/bin/phpunit"
- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpspec-${{ matrix.php-versions }}.coverage"
path: "build/coverage.xml"
coverage-upload:
name: "Upload coverage to Codecov"
runs-on: "ubuntu-18.04"
needs:
- "backend"
steps:
- uses: "actions/checkout@v2"
- name: "Download coverage files"
uses: "actions/download-artifact@v2"
with:
path: "reports"
- name: "Upload to Codecov"
uses: "codecov/codecov-action@v1"
with:
directory: "reports"
flags: "backend"