-
Notifications
You must be signed in to change notification settings - Fork 7
158 lines (139 loc) · 8.96 KB
/
magento-2.3.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Magento 2.3 Community Edition Docker container build
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 1'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cfg:
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p4, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p4, SAMPLE_DATA: true }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p4, SAMPLE_DATA: false }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p4, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p3, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p3, SAMPLE_DATA: true }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p3, SAMPLE_DATA: false }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p3, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p2, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p2, SAMPLE_DATA: true }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p2, SAMPLE_DATA: false }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p2, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p1, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7-p1, SAMPLE_DATA: true }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p1, SAMPLE_DATA: false }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7-p1, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.7, SAMPLE_DATA: true }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7, SAMPLE_DATA: false }
- { PHP_VERSION: php74-fpm, MAGENTO_VERSION: 2.3.7, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.6-p1, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.6-p1, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.6-p1, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.6-p1, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.6, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.6, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.6, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.6, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.5-p2, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.5-p2, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.5-p2, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.5-p2, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.5-p1, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.5-p1, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.5-p1, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.5-p1, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.4, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.4, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.4, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.4, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.3, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.3, SAMPLE_DATA: true }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.3, SAMPLE_DATA: false }
- { PHP_VERSION: php73-fpm, MAGENTO_VERSION: 2.3.3, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.2, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.2, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.1, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.1, SAMPLE_DATA: true }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.0, SAMPLE_DATA: false }
- { PHP_VERSION: php72-fpm, MAGENTO_VERSION: 2.3.0, SAMPLE_DATA: true }
steps:
- uses: actions/checkout@v1
- name: Cache Composer packages
uses: actions/cache@v3
with:
path: magento/vendor
key: ${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}
- name: Create vendor folder
run: mkdir magento/vendor || echo "Vendor folder already exists"
# Step 1: Build the docker image
- name: Build the Docker image (without sample data)
if: matrix.cfg.SAMPLE_DATA == false
run:
docker build magento -f magento/Dockerfile-2.3
-t michielgerritsen/magento-project-community-edition:${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}
--build-arg MAGENTO_VERSION=${{ matrix.cfg.MAGENTO_VERSION }}
--build-arg PHP_VERSION=${{ matrix.cfg.PHP_VERSION }}
- name: Build the Docker image (with sample data)
if: matrix.cfg.SAMPLE_DATA == true
run:
docker build magento -f magento/Dockerfile-2.3
-t michielgerritsen/magento-project-community-edition:${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}-sample-data
--build-arg MAGENTO_VERSION=${{ matrix.cfg.MAGENTO_VERSION }}
--build-arg PHP_VERSION=${{ matrix.cfg.PHP_VERSION }}
--build-arg SAMPLE_DATA=true
# Step 2: Test the docker image
- name: Start the docker image (without sample date)
if: matrix.cfg.SAMPLE_DATA == false
run:
docker run --memory=4G --detach --name magento-project-community-edition
michielgerritsen/magento-project-community-edition:${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}
- name: Start the docker image (with sample date)
if: matrix.cfg.SAMPLE_DATA == true
run:
docker run --detach --name magento-project-community-edition
michielgerritsen/magento-project-community-edition:${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}-sample-data
- name: Create the dummy test directory
run: docker exec magento-project-community-edition mkdir -p /data/app/code/MichielGerritsen/Magento2ExtensionIntegrationTest/Test/Integration
- name: Copy the example test module
run: |
docker exec magento-project-community-edition mkdir -p /data/extensions/MichielGerritsen-ExampleTest/Test/Integration/
docker cp Test/composer.json magento-project-community-edition:/data/extensions/MichielGerritsen-ExampleTest/
docker cp Test/ExampleTest.php magento-project-community-edition:/data/extensions/MichielGerritsen-ExampleTest/Test/Integration/
- name: Install the example test module
run: docker exec magento-project-community-edition composer require michielgerritsen/exampletest:@dev
- name: Enable developer mode
run: docker exec magento-project-community-edition ./retry "bin/magento deploy:mode:set developer"
- name: Run setup:di:compile
run: docker exec magento-project-community-edition ./retry "php bin/magento setup:di:compile"
- name: Run the example test
run: docker exec magento-project-community-edition bash -c "cd /data/dev/tests/integration/ && ../../../vendor/bin/phpunit /data/vendor/michielgerritsen/exampletest/Test/Integration/ExampleTest.php"
# Step 3: Upload the images to Docker Hub.
- name: Docker hub login
if: github.ref == 'refs/heads/master'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push the image to Docker hub (without sample data)
if: github.ref == 'refs/heads/master' && matrix.cfg.SAMPLE_DATA == false
run: docker push michielgerritsen/magento-project-community-edition:${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}
- name: Push the image to Docker hub (with sample data)
if: github.ref == 'refs/heads/master' && matrix.cfg.SAMPLE_DATA == true
run: docker push michielgerritsen/magento-project-community-edition:${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}-sample-data
- name: Copy the vendor folder for caching
run: docker cp magento-project-community-edition:/data/vendor magento/vendor
- name: Dump Docker logs files (on failure)
if: failure()
run: |
mkdir failure-logs
docker logs magento-project-community-edition > failure-logs/docker.log
docker cp magento-project-community-edition:/data/var/log failure-logs/var/log
- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: failure-artifacts-${{ matrix.cfg.PHP_VERSION }}-magento${{ matrix.cfg.MAGENTO_VERSION }}
path: |
failure-logs