-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (92 loc) · 4.12 KB
/
ci.yaml
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
102
103
104
105
106
107
108
109
110
111
112
name: Continuous Integration
on:
workflow_dispatch: ~
workflow_call:
inputs:
type:
description: "Type of the build"
required: true
type: string
jobs:
get-matrix:
runs-on: ubuntu-latest
name: "Get matrix"
outputs:
matrix: ${{ steps.matrix.outputs.prop }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
-
name: "Get matrix"
id: matrix
uses: notiz-dev/github-action-json-property@release
with:
path: '.github/workflows/_matrix.json'
prop_path: '${{ inputs.type }}.ci'
tests:
needs: get-matrix
runs-on: ubuntu-latest
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine ${{ matrix.state_machine }}"
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
STATE_MACHINE_DEFAULT_ADAPTER: ${{ matrix.state_machine }}
TPAY_CLIENT_ID: '${{ secrets.TPAY_CLIENT_ID }}'
TPAY_CLIENT_SECRET: '${{ secrets.TPAY_CLIENT_SECRET }}'
TPAY_CARDS_API: '${{ secrets.TPAY_CARDS_API }}'
PAYUM_CYPHER_KEY: '${{ secrets.PAYUM_CYPHER_KEY }}'
steps:
-
uses: actions/checkout@v3
-
name: Run Mockoon CLI
uses: mockoon/cli-action@v2
with:
version: "latest"
data-file: "./tests/mockoon_tpay.json"
port: 4000
- name: Build application
uses: SyliusLabs/[email protected]
with:
build_type: "plugin"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}"
database_version: ${{ matrix.mysql }}
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
sylius_version: ${{ matrix.sylius }}
e2e: "yes"
e2e_js: "yes"
node_version: '18.x'
- name: Check dependencies
continue-on-error: true
run: vendor/bin/composer-dependency-analyser
- name: Check service definitions
run: |
tests/Application/bin/console -edev lint:container
tests/Application/bin/console -eprod lint:container
- name: Static analysis
run: vendor/bin/phpstan
- name: Check coding standard
run: vendor/bin/ecs check
- name: Run tests (Unit)
run: vendor/bin/phpunit --testsuite unit
- name: Run tests (API)
run: vendor/bin/phpunit --testsuite api
- name: Run tests (E2E)
run: vendor/bin/phpunit --testsuite e2e
- name: Run Tpay contract tests
if: "${{ inputs.type == 'daily' }}"
run: vendor/bin/phpunit --testsuite contract_external
- name: Upload logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Logs for (Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine ${{ matrix.state_machine }})"
path: |
tests/Application/var/log
tests/Application/var/panther
if-no-files-found: ignore