-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f3041d
commit 6702735
Showing
2 changed files
with
66 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,54 +19,64 @@ jobs: | |
uses: prestashopcorp/github-action-php-cs-fixer@master | ||
|
||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
env: | ||
# Change these values depending on project. | ||
ps-module-name: mollie | ||
project-workspace-dir: ${{ github.workspace }}/../workspace | ||
strategy: | ||
matrix: | ||
PS: [ 1.7.8-7.1 ] | ||
testsuite: [ lint, phpstan, unit, integration ] | ||
|
||
- name: Cache composer folder | ||
uses: actions/cache@v1 | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
path: ~/.composer/cache | ||
key: php-composer-cache | ||
access_token: ${{ github.token }} | ||
|
||
- run: composer i | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Pull PrestaShop files | ||
run: docker run -tid --rm -v ps-volume:/var/www/html -v $PWD/:/var/www/html/modules/mollie --name temp-ps prestashop/prestashop:1.7.8.1-7.4-apache | ||
- name: Set Swap Space | ||
uses: Invertus/set-swap-space@master | ||
with: | ||
swap-size-gb: 10 | ||
|
||
- name: Run PHPunit | ||
run: docker exec -i temp-ps bash -c "cd /var/www/html/modules/mollie && composer install && ./vendor/bin/phpunit -c tests/phpunit.xml" | ||
- name: Setup PS module workspace | ||
uses: Invertus/[email protected] | ||
with: | ||
ps-module-name: ${{ env.ps-module-name }} | ||
ps-version-dockerhub-tag: ${{ matrix.PS }} | ||
project-workspace-dir: ${{ env.project-workspace-dir }} | ||
ps-module-workspace-private-key: ${{ secrets.PS_MODULE_WORKSPACE_PRIVATE_KEY }} | ||
|
||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
presta-versions: [ '1.7.6.8', '1.7.7.0', 'nightly-apache' ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Run PrestaShop | ||
run: | | ||
(cd ${{ env.project-workspace-dir }} && docker compose up -d) | ||
- name: Cache vendor folder | ||
uses: actions/cache@v1 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
- name: Healthcheck | ||
run: | | ||
timeout 120s sh -c 'until docker ps | grep ${{ env.ps-module-name }}-ps-prestashop-${{ matrix.PS }} | grep -q "(healthy)"; do echo "Waiting for container to be healthy..."; sleep 1; done' | ||
- name: Cache composer folder | ||
uses: actions/cache@v1 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.composer/cache | ||
key: php-composer-cache | ||
path: ${{ env.project-workspace-dir }}/prestashop/${{ matrix.PS }}/modules/${{ env.ps-module-name }}/vendor | ||
key: ${{ github.sha }} | ||
|
||
- name: Module composer install | ||
run: (cd ${{ env.project-workspace-dir }} && make module-composer-install) | ||
|
||
- run: composer update | ||
- name: Remove conflicting modules | ||
run: docker exec -i ${{ env.ps-module-name }}-ps-prestashop-${{ matrix.PS }} bash -c "cd /var/www/html && rm -rf modules/ps_checkout" | ||
|
||
- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }}) | ||
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }} | ||
- name: Install module | ||
run: docker exec -i ${{ env.ps-module-name }}-ps-prestashop-${{ matrix.PS }} bash -c "cd /var/www/html && php bin/console prestashop:module install ${{ env.ps-module-name }}" | ||
|
||
- name: Run PHPStan | ||
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan_base.neon --debug --error-format github | ||
- name: Run ${{ matrix.testsuite }} tests | ||
run: docker exec -i ${{ env.ps-module-name }}-ps-prestashop-${{ matrix.PS }} bash -c "cd /var/www/html/modules/${{ env.ps-module-name }} && make ci-${{ matrix.testsuite }} ps_version_tag=${{ matrix.PS }}" | ||
|
||
prepare-zip: | ||
name: Prepare module ZIP artifact | ||
|
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