Fixed github tests & added php8.2 and magento 2.4.7 to testing versions #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
# This makes sure that the tests are run on every push. See this page for more options: | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
on: push | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
# This Matrix will run the tests on PHP 7.0, 7.1 and 7.2 and on Magento 2.2.11 and 2.3.5-p1. | |
# Magento 2.3.5-p1 requires PHP 7.1 and higher, so PHP 7.0 is disabled for this version. | |
# Magento 2.2.11 supports PHP up to version 7.1, so PHP 7.2 is disabled for this version. | |
matrix: | |
include: | |
- PHP_VERSION: php73-fpm | |
MAGENTO_VERSION: 2.3.7 | |
- PHP_VERSION: php74-fpm | |
MAGENTO_VERSION: 2.4.3-p1 | |
- PHP_VERSION: php81-fpm | |
MAGENTO_VERSION: 2.4.5-p1 | |
- PHP_VERSION: php82-fpm | |
MAGENTO_VERSION: 2.4.7-p1 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
# Download the correct Docker image with the correct Magento & PHP version for this specific run. | |
- name: Start Docker | |
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }} | |
# Create separate branch and remove version from `composer.json`. | |
- name: Create branch for Composer and remove version from composer.json | |
run: git checkout -b unit-test-branch && sed -i '/version/d' ./composer.json | |
# If your code is not in the root but in a subdirecty you need to change this command. | |
# Example: If your code is in the `src` folder then you need to do this: | |
# run: docker cp $(pwd)/src magento-project-community-edition:/data/extensions/ | |
- name: Upload our code into the docker container | |
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ | |
# Replace <VENDOR> and <MODULE> with the name in your `composer.json`. | |
- name: Install the extension in Magento | |
run: docker exec magento-project-community-edition composer require cmdotcom-plugins/magento2-payments:@dev | |
# Only the tests in your repository will be run, the default Magento tests are not included in this. | |
- name: Run tests | |
run: docker exec magento-project-community-edition bash -c "vendor/bin/phpunit extensions/${{ github.event.repository.name }}/Test/Unit" |