forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (97 loc) · 4.67 KB
/
ci_e2e-pgsql.yaml
File metadata and controls
112 lines (97 loc) · 4.67 KB
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: End-to-End (PostgreSQL)
on:
workflow_dispatch: ~
workflow_call:
inputs:
branch:
description: "Branch"
required: false
type: string
default: ""
type:
description: "Type of the build"
required: true
type: string
permissions:
contents: read
jobs:
get-matrix:
runs-on: ubuntu-latest
name: "Get matrix"
outputs:
matrix: ${{ steps.matrix.outputs.prop }}
steps:
- name: "Checkout (With Branch)"
if: "${{ inputs.branch != '' }}"
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: "Checkout"
uses: actions/checkout@v4
if: "${{ inputs.branch == '' }}"
-
name: "Get matrix"
id: matrix
uses: notiz-dev/github-action-json-property@release
with:
path: '.github/workflows/matrix.json'
prop_path: '${{ inputs.type }}.e2e-pgsql'
behat-no-js:
needs: get-matrix
runs-on: ubuntu-latest
name: "Non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PostgreSQL ${{ matrix.postgres }}"
timeout-minutes: 45
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
env:
APP_ENV: test_cached
DATABASE_URL: "pgsql://postgres:postgres@127.0.0.1/sylius?charset=utf8&serverVersion=${{ matrix.postgres }}"
steps:
- name: Set variables
shell: bash
env:
BRANCH: ${{ inputs.branch }}
run: |
if [ "$BRANCH" == "1.12" ]; then
echo "USE_LEGACY_POSTGRES_SETUP=yes" >> $GITHUB_ENV
else
echo "USE_LEGACY_POSTGRES_SETUP=no" >> $GITHUB_ENV
fi
- name: "Checkout (With Branch)"
if: "${{ inputs.branch != '' }}"
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: "Checkout"
if: "${{ inputs.branch == '' }}"
uses: actions/checkout@v4
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v2.2
with:
build_type: "sylius"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-"
e2e: "yes"
database: "postgresql"
database_version: ${{ matrix.postgres }}
legacy_postgresql_setup: ${{ env.USE_LEGACY_POSTGRES_SETUP }}
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
- name: Run PHPUnit
run: vendor/bin/phpunit --colors=always
- name: Run CLI Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@cli&&~@todo" --suite-tags="@cli" --rerun
- name: Run non-UI Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain,@hybrid" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@todo&&~@cli&&~@no-postgres" --suite-tags="@api,@domain,@hybrid" --rerun
- name: Run non-JS Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@ui" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript&&~@mink:chromedriver&&~@todo&&~@cli&&~@no-postgres" --suite-tags="@ui" --rerun
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: "Logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PostgreSQL ${{ matrix.postgres }})"
path: |
etc/build/
var/log
if-no-files-found: ignore