|
1 | 1 | version: 2
|
2 | 2 |
|
3 | 3 | shared: &shared
|
4 |
| - working_directory: ~/build_directory/algoliasearch-magento-2 |
5 |
| - steps: |
6 |
| - - checkout |
| 4 | + working_directory: ~/build_directory/algoliasearch-magento-2 |
| 5 | + steps: |
| 6 | + - checkout |
7 | 7 |
|
8 |
| - - run: |
9 |
| - name: Override the Algolia extension with the cloned one |
10 |
| - command: | |
11 |
| - cd ~/magento_directory/vendor/algolia |
12 |
| - rm -rf algoliasearch-magento-2 |
13 |
| - cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia |
14 |
| - cd ~/magento_directory |
15 |
| - composer dump-autoload |
| 8 | + - run: |
| 9 | + name: Override the Algolia extension with the cloned one |
| 10 | + command: | |
| 11 | + cd ~/magento_directory/vendor/algolia |
| 12 | + rm -rf algoliasearch-magento-2 |
| 13 | + cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia |
| 14 | + cd ~/magento_directory |
| 15 | + composer dump-autoload |
16 | 16 |
|
17 |
| - - run: |
18 |
| - name: Start database server |
19 |
| - command: | |
20 |
| - sudo service mysql start |
21 |
| - sleep 2 |
22 |
| - ps aux | grep mysql |
| 17 | + - run: |
| 18 | + name: Start database server |
| 19 | + command: | |
| 20 | + sudo service mysql start |
| 21 | + sleep 2 |
| 22 | + ps aux | grep mysql |
23 | 23 |
|
24 |
| - - run: |
25 |
| - name: Install the extension |
26 |
| - command: | |
27 |
| - cd ~/magento_directory |
28 |
| - sudo service elasticsearch start # for some reasons has to be launched with the step |
29 |
| - sleep 10 |
30 |
| - php -dmemory_limit=-1 bin/magento module:disable Magento_WebapiAsync Magento_Amqp Magento_MysqlMq Magento_MessageQueue |
31 |
| - php -dmemory_limit=-1 bin/magento module:enable Algolia_AlgoliaSearch |
32 |
| - php -dmemory_limit=-1 bin/magento setup:upgrade |
| 24 | + - run: |
| 25 | + name: Install the extension |
| 26 | + command: | |
| 27 | + cd ~/magento_directory |
| 28 | + sudo service elasticsearch start # for some reasons has to be launched with the step |
| 29 | + sleep 10 |
| 30 | + php -dmemory_limit=-1 bin/magento module:disable Magento_WebapiAsync Magento_Amqp Magento_MysqlMq Magento_MessageQueue |
| 31 | + php -dmemory_limit=-1 bin/magento module:enable Algolia_AlgoliaSearch |
| 32 | + php -dmemory_limit=-1 bin/magento setup:upgrade |
33 | 33 |
|
34 |
| - - run: |
35 |
| - name: Get the right tests config for DB and administration |
36 |
| - command: | |
37 |
| - rm -rf ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension/Test ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension-chat/Test |
38 |
| - mv ~/build_directory/algoliasearch-magento-2/dev/tests/install-config-mysql.php ~/magento_directory/dev/tests/integration/etc/install-config-mysql.php |
| 34 | + - run: |
| 35 | + name: Get the right tests config for DB and administration |
| 36 | + command: | |
| 37 | + rm -rf ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension/Test ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension-chat/Test |
| 38 | + mv ~/build_directory/algoliasearch-magento-2/dev/tests/install-config-mysql.php ~/magento_directory/dev/tests/integration/etc/install-config-mysql.php |
39 | 39 |
|
40 |
| - - run: |
41 |
| - name: Before setup |
42 |
| - command: | |
43 |
| - echo 'memory_limit = 256M' | sudo tee /usr/local/etc/php/php.ini |
| 40 | + - run: |
| 41 | + name: Before setup |
| 42 | + command: | |
| 43 | + echo 'memory_limit = 256M' | sudo tee /usr/local/etc/php/php.ini |
44 | 44 |
|
45 |
| - - run: |
46 |
| - name: Get keys from dealer |
47 |
| - command: | |
48 |
| - if [ "$CIRCLE_PR_REPONAME" ]; then |
49 |
| - curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV |
50 |
| - fi |
| 45 | + - run: |
| 46 | + name: Get keys from dealer |
| 47 | + command: | |
| 48 | + if [ "$CIRCLE_PR_REPONAME" ]; then |
| 49 | + curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV |
| 50 | + fi |
51 | 51 |
|
52 |
| - - run: |
53 |
| - name: Run tests |
54 |
| - command: | |
55 |
| - cd ~/magento_directory/dev/tests/integration |
56 |
| - sudo service elasticsearch start # for some reasons has to be launched with the step |
57 |
| - sleep 10 |
58 |
| - php -dmemory_limit=-1 ../../../vendor/bin/phpunit --debug ../../../vendor/algolia/algoliasearch-magento-2/Test |
| 52 | + - run: |
| 53 | + name: Run tests |
| 54 | + command: | |
| 55 | + cd ~/magento_directory/dev/tests/integration |
| 56 | + sudo service elasticsearch start # for some reasons has to be launched with the step |
| 57 | + sleep 10 |
| 58 | + php -dmemory_limit=-1 ../../../vendor/bin/phpunit --debug ../../../vendor/algolia/algoliasearch-magento-2/Test |
59 | 59 |
|
60 | 60 | jobs:
|
61 |
| - "magento-2.3": |
62 |
| - <<: *shared |
63 |
| - docker: |
64 |
| - - image: algolia/magento2-circleci:v3-2.3.5-p2 |
| 61 | + "magento-2.3": |
| 62 | + <<: *shared |
| 63 | + docker: |
| 64 | + - image: algolia/magento2-circleci:v3-2.3.5-p2 |
| 65 | + |
| 66 | + "magento-2.4": |
| 67 | + <<: *shared |
| 68 | + docker: |
| 69 | + - image: algolia/magento2-circleci:v3-2.4.0 |
65 | 70 |
|
66 |
| - "magento-2.4": |
67 |
| - <<: *shared |
68 |
| - docker: |
69 |
| - - image: algolia/magento2-circleci:v3-2.4.0 |
| 71 | + "quality-tools": |
| 72 | + docker: |
| 73 | + - image: algolia/magento2-circleci:2.4.4-php7.4-v1 |
| 74 | + working_directory: ~/build_directory/algoliasearch-magento-2 |
| 75 | + steps: |
| 76 | + - checkout |
| 77 | + - run: |
| 78 | + name: Setting permissions |
| 79 | + command: | |
| 80 | + sudo chown circleci:circleci ~/.composer/ |
| 81 | + - restore_cache: |
| 82 | + keys: |
| 83 | + - composer-v4-{{ checksum "composer.json" }} |
| 84 | + - composer-v4- |
70 | 85 |
|
71 |
| - "quality-tools": |
72 |
| - docker: |
73 |
| - - image: algolia/magento2-circleci:2.4.4-php7.4-v1 |
74 |
| - working_directory: ~/build_directory/algoliasearch-magento-2 |
75 |
| - steps: |
76 |
| - - checkout |
77 |
| - - run: |
78 |
| - name: Setting permissions |
79 |
| - command: | |
80 |
| - sudo chown circleci:circleci ~/.composer/ |
81 |
| - - restore_cache: |
82 |
| - keys: |
83 |
| - - composer-v4-{{ checksum "composer.json" }} |
84 |
| - - composer-v4- |
85 |
| - |
86 |
| - - run: |
87 |
| - name: Prepare environment |
88 |
| - command: | |
89 |
| - sudo chown circleci:circleci ~/.composer/ |
90 |
| - composer global config prefer-stable true |
91 |
| - composer global config minimum-stability dev |
92 |
| - composer global require algolia/magento2-tools |
| 86 | + - run: |
| 87 | + name: Prepare environment |
| 88 | + command: | |
| 89 | + sudo chown circleci:circleci ~/.composer/ |
| 90 | + composer global config prefer-stable true |
| 91 | + composer global config minimum-stability dev |
| 92 | + composer global require algolia/magento2-tools |
93 | 93 |
|
94 |
| - # We have to do this again because we restore the cache above, overwriting the vendor with the original. |
95 |
| - mkdir ~/magento_directory/vendor/algolia |
96 |
| - # rm -rf algoliasearch-magento-2 |
97 |
| - cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia |
98 |
| - cd ~/magento_directory |
99 |
| - composer dump-autoload |
100 |
| - - save_cache: |
101 |
| - key: composer-v4-{{ checksum "composer.json" }} |
102 |
| - paths: |
103 |
| - - vendor |
104 |
| - - run: |
105 |
| - name: Quality tools |
106 |
| - command: | |
107 |
| - sudo ~/.composer/vendor/bin/magento2-test ~/magento_directory/vendor/algolia/algoliasearch-magento-2 ~/.composer/vendor/bin/ |
| 94 | + # We have to do this again because we restore the cache above, overwriting the vendor with the original. |
| 95 | + mkdir ~/magento_directory/vendor/algolia |
| 96 | + # rm -rf algoliasearch-magento-2 |
| 97 | + cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia |
| 98 | + cd ~/magento_directory |
| 99 | + composer dump-autoload |
| 100 | + - save_cache: |
| 101 | + key: composer-v4-{{ checksum "composer.json" }} |
| 102 | + paths: |
| 103 | + - vendor |
| 104 | + - run: |
| 105 | + name: Quality tools |
| 106 | + command: | |
| 107 | + sudo ~/.composer/vendor/bin/magento2-test ~/magento_directory/vendor/algolia/algoliasearch-magento-2 ~/.composer/vendor/bin/ |
108 | 108 |
|
109 | 109 | workflows:
|
110 |
| - version: 2 |
111 |
| - build: |
112 |
| - jobs: |
113 |
| - - "magento-2.3" |
114 |
| - - "magento-2.4" |
115 |
| - - "quality-tools" |
| 110 | + version: 2 |
| 111 | + build: |
| 112 | + jobs: |
| 113 | + - "magento-2.3" |
| 114 | + - "magento-2.4" |
| 115 | + - "quality-tools" |
0 commit comments