From 46a7ab7d2a18e5ac45b1557dc9aff528804d7569 Mon Sep 17 00:00:00 2001 From: Filip Sushko Date: Mon, 30 May 2022 09:23:47 +0200 Subject: [PATCH] SC-9416: Migrate from Travis to Github Actions (#324) * SC-9416: added boot-syntax-check-tests.yml + deploy-file-builder-tests.yml * SC-9416: added b2b+b2c support * SC-9416: added all images with php 7.4 * SC-9416: added all images with php 7.4 * SC-9416: optimized image matrix --- .github/workflows/b2b-b2c-demo-shop-tests.yml | 88 ++++++++++ .github/workflows/boot-syntax-check-tests.yml | 74 ++++++++ .../workflows/deploy-file-builder-tests.yml | 27 +++ .travis.yml | 161 ------------------ 4 files changed, 189 insertions(+), 161 deletions(-) create mode 100644 .github/workflows/b2b-b2c-demo-shop-tests.yml create mode 100644 .github/workflows/boot-syntax-check-tests.yml create mode 100644 .github/workflows/deploy-file-builder-tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/b2b-b2c-demo-shop-tests.yml b/.github/workflows/b2b-b2c-demo-shop-tests.yml new file mode 100644 index 000000000..158d8a26e --- /dev/null +++ b/.github/workflows/b2b-b2c-demo-shop-tests.yml @@ -0,0 +1,88 @@ +name: B2B + B2C Demoshop tests +on: + - push + +env: + SPRYKER_TESTING_ENABLED: 1 + PROJECT: suite + +jobs: + functional_test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform-image: [ + 'spryker/php:7.4-alpine3.14', + 'spryker/php:7.4-debian' + ] + application-store: [ 'DE' ] + env: [ + 'ci.mysql', + 'ci.pgsql' + ] + repo: [ + 'https://github.com/spryker-shop/b2b-demo-shop.git', + 'https://github.com/spryker-shop/b2c-demo-shop.git' + ] + name: "Function Tests(Image: ${{ matrix.platform-image }}, Environment: ${{ matrix.env }}, Repo: ${{ matrix.repo }})" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Clone demo shop + run: cd ../ && git clone --depth=3 --branch=master ${{ matrix.repo }} demo-shop && cp -R docker-sdk demo-shop + + - name: Provide env variables + run: | + export SPRYKER_PLATFORM_IMAGE=${{ matrix.platform-image}} + export APPLICATION_ENV=${{ matrix.env }} + export APPLICATION_STORE=${{ matrix.application-store }} + + - name: Run script + run: | + cd ../demo-shop + docker-sdk/sdk boot deploy.ci.functional.mariadb.yml -v + docker-sdk/sdk up -t -v + docker-sdk/sdk testing codecept run -c codeception.ci.functional.yml + + glue_test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform-image: [ + 'spryker/php:7.4-alpine3.15', + 'spryker/php:7.4-debian-buster' + ] + application-store: [ 'DE' ] + env: [ + 'ci.mysql', + 'ci.pgsql' + ] + repo: [ + 'https://github.com/spryker-shop/b2b-demo-shop.git', + 'https://github.com/spryker-shop/b2c-demo-shop.git' + ] + name: "Glue Tests(Image: ${{ matrix.platform-image }}, Environment: ${{ matrix.env }}, Repo: ${{ matrix.repo }})" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Clone demo shop + run: cd ../ && git clone --depth=3 --branch=master ${{ matrix.repo }} demo-shop && cp -R docker-sdk demo-shop + + - name: Provide env variables + run: | + export SPRYKER_PLATFORM_IMAGE=${{ matrix.platform-image}} + export APPLICATION_ENV=${{ matrix.env }} + export APPLICATION_STORE=${{ matrix.application-store }} + + - name: Run script + run: | + cd ../demo-shop + docker-sdk/sdk boot deploy.ci.api.yml -v + docker-sdk/sdk up -t -v + docker-sdk/sdk testing codecept fixtures + docker-sdk/sdk testing console queue:worker:start --stop-when-empty + docker-sdk/sdk testing codecept run -c codeception.api.yml diff --git a/.github/workflows/boot-syntax-check-tests.yml b/.github/workflows/boot-syntax-check-tests.yml new file mode 100644 index 000000000..65ee3943b --- /dev/null +++ b/.github/workflows/boot-syntax-check-tests.yml @@ -0,0 +1,74 @@ +name: Boot & Syntax check & tTests + +on: + - push + +jobs: + boot_test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + dev-mode: [ + DEV_MODE=0, + DEV_MODE=1 + ] + name: Boot test + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Boot + run: | + export ${{ matrix.dev-mode }} + chmod +x sdk + if [[ $DEV_MODE == 0 ]] ; then ./sdk boot ci/deploy.yml; fi + if [[ $DEV_MODE == 1 ]] ; then ./sdk boot ci/deploy.dev.yml; fi + + - name: Run script + run: bash ./ci/check_boot.sh + + bash_syntax_check: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + dev-mode: [ + DEV_MODE=0, + DEV_MODE=1 + ] + name: Bash syntax check + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Boot + run: | + export ${{ matrix.dev-mode }} + chmod +x sdk + if [[ $DEV_MODE == 0 ]] ; then ./sdk boot ci/deploy.yml; fi + if [[ $DEV_MODE == 1 ]] ; then ./sdk boot ci/deploy.dev.yml; fi + + - name: Run script + run: bash ./ci/check_boot.sh + + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + dev-mode: [ DEV_MODE=0, DEV_MODE=1 ] + name: Tests + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Boot + run: | + export ${{ matrix.dev-mode }} + chmod +x sdk + if [[ $DEV_MODE == 0 ]] ; then ./sdk boot ci/deploy.yml; fi + if [[ $DEV_MODE == 1 ]] ; then ./sdk boot ci/deploy.dev.yml; fi + + - name: Run script + run: bash ./ci/tests.sh diff --git a/.github/workflows/deploy-file-builder-tests.yml b/.github/workflows/deploy-file-builder-tests.yml new file mode 100644 index 000000000..c7df9a69f --- /dev/null +++ b/.github/workflows/deploy-file-builder-tests.yml @@ -0,0 +1,27 @@ +name: Deploy file builder tests + +on: + - push + +jobs: + deploy_file_builder_tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: [ 7.4 ] + name: Deploy file builder tests + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: Run script + run: | + cd generator + composer install + vendor/bin/codecept run diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 06ee2d47a..000000000 --- a/.travis.yml +++ /dev/null @@ -1,161 +0,0 @@ -dist: bionic - -sudo: required - -git: - depth: 3 - -os: linux -language: minimal - -env: - global: - - PROGRESS_TYPE=plain - -cache: - timeout: 60 - -addons: - hosts: - - yves.de.spryker.local - - zed.de.spryker.local - - glue.de.spryker.local - apt: - packages: - - apache2-utils - - apt-transport-https - - ca-certificates - - curl - - gnupg-agent - - pigz - - software-properties-common - sources: - - sourceline: "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - key_url: https://download.docker.com/linux/ubuntu/gpg - -before_install: - - echo eyAiZXhwZXJpbWVudGFsIiA6IHRydWUsICJmZWF0dXJlcyIgOiB7ICJidWlsZGtpdCI6IHRydWUgfSB9Cg==|base64 -d|sudo tee /etc/docker/daemon.json - - sudo apt-get install --only-upgrade docker-ce -y - - sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - - sudo chmod +x /usr/local/bin/docker-compose - - sudo systemctl start docker - -matrix: - fast_finish: true - allow_failures: [] - include: - - name: Demo boot test - env: DEV_MODE=0 - script: - - bash ./ci/check_boot.sh - - name: Dev boot test - env: DEV_MODE=1 - script: - - bash ./ci/check_boot.sh - - name: Demo Bash syntax check - env: DEV_MODE=0 - script: - - bash ./ci/check_bash_syntax.sh - - name: Demo Bash syntax check - env: DEV_MODE=1 - script: - - bash ./ci/check_bash_syntax.sh - - name: Tests - script: - - bash ./ci/tests.sh - before_install: skip - before_script: skip - after_script: skip - - name: Deploy file builder tests - language: php - php: 7.4 - script: - - cd generator - - composer install - - vendor/bin/codecept run - - name: Docker / B2C Demoshop / PHP-7.4 Alpine / MariaDB / Functional - env: - - SPRYKER_PLATFORM_IMAGE=spryker/php:7.4-alpine3.14 - - TRAVIS=1 - - APPLICATION_ENV=ci.mysql - - SPRYKER_TESTING_ENABLED=1 - - APPLICATION_STORE=DE - - PROJECT=suite - script: - - cd ../ && git clone --depth=3 --branch=master https://github.com/spryker-shop/b2c-demo-shop.git demo-shop && mv docker-sdk demo-shop && cd demo-shop - - docker-sdk/sdk boot deploy.ci.functional.mariadb.yml -v - - docker-sdk/sdk up -t -v - - docker-sdk/sdk testing codecept run -c codeception.ci.functional.yml - before_script: skip - after_script: skip - - name: Docker / B2C Demoshop / PHP-7.4 Debian / PostgreSQL / Functional - env: - - SPRYKER_PLATFORM_IMAGE=spryker/php:7.4-debian - - TRAVIS=1 - - APPLICATION_ENV=ci.pgsql - - SPRYKER_TESTING_ENABLED=1 - - APPLICATION_STORE=DE - - PROJECT=suite - script: - - cd ../ && git clone --depth=3 --branch=master https://github.com/spryker-shop/b2c-demo-shop.git demo-shop && mv docker-sdk demo-shop && cd demo-shop - - docker-sdk/sdk boot deploy.ci.functional.yml -v - - docker-sdk/sdk up -t -v - - docker-sdk/sdk testing codecept run -c codeception.ci.functional.yml - before_script: skip - after_script: skip - - name: Docker / B2B Demoshop / PHP-7.4 Alpine / PostgreSQL / Functional - env: - - SPRYKER_PLATFORM_IMAGE=spryker/php:7.4-alpine3.15 - - TRAVIS=1 - - APPLICATION_ENV=ci.pgsql - - SPRYKER_TESTING_ENABLED=1 - - APPLICATION_STORE=DE - - PROJECT=suite - script: - - cd ../ && git clone --depth=3 --branch=master https://github.com/spryker-shop/b2b-demo-shop.git demo-shop && mv docker-sdk demo-shop && cd demo-shop - - docker-sdk/sdk boot deploy.ci.functional.yml -v - - docker-sdk/sdk up -t -v - - docker-sdk/sdk testing codecept run -c codeception.ci.functional.yml - before_script: skip - after_script: skip - - name: Docker / B2B Demoshop / PHP-7.4 Debian / MariaDB / Functional - env: - - SPRYKER_PLATFORM_IMAGE=spryker/php:7.4-debian - - TRAVIS=1 - - APPLICATION_ENV=ci.mysql - - SPRYKER_TESTING_ENABLED=1 - - APPLICATION_STORE=DE - - PROJECT=suite - script: - - cd ../ && git clone --depth=3 --branch=master https://github.com/spryker-shop/b2b-demo-shop.git demo-shop && mv docker-sdk demo-shop && cd demo-shop - - docker-sdk/sdk boot deploy.ci.functional.mariadb.yml -v - - docker-sdk/sdk up -t -v - - docker-sdk/sdk testing codecept run -c codeception.ci.functional.yml - before_script: skip - after_script: skip - - name: Docker / B2B Demoshop / PHP-7.4 Alpine / MariaDB / Glue - env: - - SPRYKER_PLATFORM_IMAGE=spryker/php:7.4-alpine3.15 - - TRAVIS=1 - - APPLICATION_ENV=ci.mysql - - SPRYKER_TESTING_ENABLED=1 - - APPLICATION_STORE=DE - - PROJECT=suite - script: - - cd ../ && git clone --depth=3 --branch=master https://github.com/spryker-shop/b2b-demo-shop.git demo-shop && mv docker-sdk demo-shop && cd demo-shop - - docker-sdk/sdk boot deploy.ci.api.yml -v - - docker-sdk/sdk up -t -v - - docker-sdk/sdk testing codecept fixtures - - docker-sdk/sdk testing console queue:worker:start --stop-when-empty - - docker-sdk/sdk testing codecept run -c codeception.api.yml - before_script: skip - after_script: skip - -before_script: - - chmod +x sdk - - if [[ $DEV_MODE == 0 ]] ; then ./sdk boot ci/deploy.yml; fi - - if [[ $DEV_MODE == 1 ]] ; then ./sdk boot ci/deploy.dev.yml; fi - -notifications: - email: false -