-
Notifications
You must be signed in to change notification settings - Fork 7
95 lines (83 loc) · 4.53 KB
/
Copy pathintegration-tests.yml
File metadata and controls
95 lines (83 loc) · 4.53 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
name: Magento 2 Integration Tests
on: ['push', 'pull_request']
jobs:
integration-tests:
name: Magento 2 Integration Tests
runs-on: ubuntu-latest
container:
image: yireo/magento2installed:2.4.8-p3
services:
mysql:
image: yireo/mariadb:10
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: magento2
MYSQL_PASSWORD: magento2
MYSQL_DATABASE: magento2
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
opensearch:
image: yireo/opensearch:latest
env:
'discovery.type': single-node
ES_JAVA_OPTS: "-Xms256m -Xmx256m"
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Detecting integration tests
run: |
test -d $GITHUB_WORKSPACE/Test/Integration || echo "SKIP_JOB=true" >> $GITHUB_ENV
- name: Cleanup PHP
if: env.SKIP_JOB != 'true'
run: |
test -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini || true
- name: Apply patch for reporting memory under Alpine
if: env.SKIP_JOB != 'true'
run: cd /tmp/magento && curl -fsSL https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/39216.diff | git apply || true
- name: Apply patch for changing MySQL client configuration
if: env.SKIP_JOB != 'true'
run: cd /tmp/magento && curl -fsSL https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/40410.diff | git apply || true
- name: Setting up module variables
if: env.SKIP_JOB != 'true'
run: |
echo COMPOSER_NAME=`jq -e '.name' composer.json -r` >> $GITHUB_ENV
echo MAGENTO_MODULE=`jq -e '.module_name' MODULE.json -r` >> $GITHUB_ENV
- name: Configure GitLab
if: env.SKIP_JOB != 'true'
run: |
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
cd /tmp/magento
composer config --auth gitlab-token.gitlab.yireo.com "${{ secrets.GITLAB_TOKEN }}"
composer config repositories.loki-third-party composer https://gitlab.yireo.com/api/v4/group/loki-third-party/-/packages/composer/packages.json
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
composer config repositories.loki-checkout-dev composer https://gitlab.yireo.com/api/v4/group/loki-checkout-dev/-/packages/composer/packages.json
- name: Configure Magento Marketplace
if: env.SKIP_JOB != 'true'
run: |
test -n "${{ secrets.MAGENTO_MARKETPLACE_PUBLIC_KEY }}" || exit 0
composer config --global --auth http-basic.repo.magento.com "${{ secrets.MAGENTO_MARKETPLACE_PUBLIC_KEY }}" "${{ secrets.MAGENTO_MARKETPLACE_PRIVATE_KEY }}"
- name: Configure composer
if: env.SKIP_JOB != 'true'
run: |
cd /tmp/magento
composer config --global --auth github-oauth.github.com "${{ secrets.COMPOSER_GITHUB_TOKEN }}"
test -f $GITHUB_WORKSPACE/.github/workflows/composer-additional.sh && source $GITHUB_WORKSPACE/.github/workflows/composer-additional.sh || true
test -f $GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh && source $GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh || true
- name: Add module source
if: env.SKIP_JOB != 'true'
run: |
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
cd /tmp/magento
composer config repositories.local-source path package-source/
composer require -n --prefer-source -- ${COMPOSER_NAME}:@dev yireo/magento2-integration-test-helper
- name: Run Magento 2 Integration Tests
if: env.SKIP_JOB != 'true'
run: |
cd /tmp/magento/dev/tests/integration/
cp -R ${GITHUB_WORKSPACE}/.github/workflows/integration-tests/* .
php ../../../vendor/bin/phpunit --atleast-version 9 && cp phpunit9.xml phpunit.xml
php ../../../vendor/bin/phpunit --atleast-version 10 && cp phpunit10.xml phpunit.xml
php -d memory_limit=-1 ../../../vendor/bin/phpunit -c phpunit.xml ../../../vendor/$COMPOSER_NAME/Test/Integration