-
Notifications
You must be signed in to change notification settings - Fork 5k
80 lines (69 loc) · 2.45 KB
/
sanity.yml
File metadata and controls
80 lines (69 loc) · 2.45 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
name: UI tests
on: [ push, pull_request ]
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
TEST_CAMPAIGN: 'sanity:fast-fail'
jobs:
# Define which PHP versions need to be used
workflow_matrix_generator:
name: Sanity matrix
uses: ./.github/workflows/workflow-matrix-generator.yml
with:
matrix_type: sanity
sanity:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
name: Sanity
needs: workflow_matrix_generator
strategy:
matrix: ${{ fromJSON(needs.workflow_matrix_generator.outputs.dynamic_matrix) }}
fail-fast: false
steps:
- name: Prepare docker prefix with repository name lower cased
run: |
REPOSITORY_NAME=${{ github.event.repository.name }}
echo "DOCKER_PREFIX=${REPOSITORY_NAME@L}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Setup Environment
timeout-minutes: 15
uses: ./.github/actions/setup-env
with:
PHP_VERSION: ${{ matrix.php }}
ENABLE_SSL: 'true'
INSTALL_AUTO: 'false'
DB_SERVER: ${{ matrix.db }}
- name: Setup Environment failure
uses: ./.github/actions/setup-env-export-logs
with:
DOCKER_PREFIX: ${{ env.DOCKER_PREFIX }}
ARTIFACT_NAME: setup-sanity-${{ matrix.php }}-${{ matrix.browser }}-${{ matrix.db }}
DB_SERVER: ${{ matrix.db }}
ENABLE_SSL: 'true'
INSTALL_AUTO: 'false'
if: failure()
- name: Run Tests
uses: ./.github/actions/ui-test
with:
TEST_CAMPAIGN: ${{ env.TEST_CAMPAIGN }}
BROWSER: ${{ matrix.browser }}
DB_SERVER: ${{ matrix.db }}
- name: Export docker logs
if: failure()
run: |
mkdir -p ./var/docker-logs
docker logs prestashop-${{ matrix.db }}-1 > ./var/docker-logs/${{ matrix.db }}.log
docker logs ${{ inputs.DOCKER_PREFIX }}-prestashop-git-1 > ./var/docker-logs/prestashop.log
- name: Upload Screenshots and logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: sanity-${{ matrix.php }}-${{ matrix.browser }}-${{ matrix.db }}
path: |
./tests/UI/screenshots/
./var/logs
./var/docker-logs