Skip to content

Commit

Permalink
ci(*): Add tests for 2.4.7 and PHP 8.3 (#9)
Browse files Browse the repository at this point in the history
* ci(*): Add 2.4.7 and php 8.3 in test matrixes

* feat(*): Prepare release 1.1.1
  • Loading branch information
julienloizelet committed Apr 12, 2024
1 parent 5c58b1e commit 266a15a
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 48 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/end-to-end-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
include:
- m2-version: '2.3.7-p4'
php-version: '7.4'
- m2-version: '2.4.5'
php-version: '8.1'
- m2-version: '2.4.6'
php-version: '8.2'
- m2-version: '2.4.7'
php-version: '8.3'

name: End-to-end test suite
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
Expand All @@ -45,12 +45,12 @@ jobs:

- name: Install Magento 2 with DDEV
id: magento_install
uses: julienloizelet/magento2-ddev-installation@v2.1.1
uses: julienloizelet/magento2-ddev-installation@v3
with:
php_version: ${{ matrix.php-version }}
magento_version: ${{ matrix.m2-version }}
composer_auth: ${{ secrets.M2_COMPOSER_AUTH }}
magento_repository: "https://mirror.mage-os.org/"
magento_repository: "https://repo.magento.com/"

- name: Add Redis and Memcached
run: |
Expand All @@ -63,7 +63,7 @@ jobs:
run: ddev get julienloizelet/ddev-playwright

- name: Clone M2 ${{ env.EXTENSION_NAME }} files
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: my-own-modules/${{ env.EXTENSION_PATH }}

Expand All @@ -80,8 +80,8 @@ jobs:
run: |
ddev composer require ${{ env.EXTENSION_PACKAGE_NAME }}:@dev --no-interaction
- name: Disable some extensions for 2.4.6
if: startsWith(matrix.m2-version, '2.4.6')
- name: Disable some extensions for 2.4.6 and superior
if: contains(fromJson('["2.4.6", "2.4.7"]'),matrix.m2-version)
run: |
ddev magento module:disable Magento_AdminAdobeImsTwoFactorAuth
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
run: ddev playwright test reports

- name: Keep Playwright report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.php-version }}-${{ matrix.m2-version }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/installation-and-varnish-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
include:
- m2-version: '2.3.7'
php-version: '7.4'
- m2-version: '2.4.6'
php-version: '8.2'
- m2-version: '2.4.7'
php-version: '8.3'

name: Installation and Varnish test suite
# @see https://devdocs.magento.com/marketplace/sellers/installation-and-varnish-tests.html
Expand All @@ -42,7 +42,7 @@ jobs:

steps:
- name: Install Magento 2 with DDEV
uses: julienloizelet/magento2-ddev-installation@v2.1.1
uses: julienloizelet/magento2-ddev-installation@v3
id: magento2-install
with:
php_version: ${{ matrix.php-version }}
Expand Down Expand Up @@ -84,8 +84,8 @@ jobs:
ddev magento config:set system/full_page_cache/caching_application 2
ddev magento setup:performance:generate-fixtures ./varnish-profile.xml
- name: Disable some extensions for 2.4.6
if: startsWith(matrix.m2-version, '2.4.6')
- name: Disable some extensions for 2.4.7
if: startsWith(matrix.m2-version, '2.4.7')
run: |
ddev magento maintenance:enable
ddev magento module:disable --clear-static-content Magento_AdminAdobeImsTwoFactorAuth
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:

- name: Clone sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: extension

Expand Down
54 changes: 28 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@ on:
tag_name:
type: string
required: true
draft:
type: boolean
description: Draft release
default: false
prerelease:
type: boolean
description: Prerelease
default: false
first-release:
type: boolean
description: First release
default: false
only_zip_for_marketplace:
type: boolean
description: Only create zip for marketplace
required: true
default: true


env:
# Allow ddev get to use a GitHub token to prevent rate limiting by tests
Expand Down Expand Up @@ -51,7 +45,7 @@ jobs:
echo "VERSION_SOURCES=$(echo ${{ env.EXTENSION_ZIP_NAME }}-${{ env.VERSION_NUMBER }} )" >> $GITHUB_ENV
- name: Clone sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ env.VERSION_SOURCES }}

Expand Down Expand Up @@ -92,27 +86,24 @@ jobs:
fi
# Check top [_Compare with previous release_](GITHUB_URL/compare/vLAST_TAG...vVERSION_NUMBER) in CHANGELOG.md
if [[ ${{ github.event.inputs.first-release }} != "true" ]]
COMPARISON=$(grep -oP "\/compare\/\K(.*)$" CHANGELOG.md | head -1)
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$")
if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]]
then
COMPARISON=$(grep -oP "\/compare\/\K(.*)$" CHANGELOG.md | head -1)
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$")
if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]]
then
echo "VERSION COMPARISON OK"
else
echo "VERSION COMPARISON KO"
echo $COMPARISON
echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})"
exit 1
fi
echo "VERSION COMPARISON OK"
else
echo "VERSION COMPARISON KO"
echo $COMPARISON
echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})"
exit 1
fi
- name: Create zip
run: |
zip -r ${{ env.VERSION_SOURCES }}.zip ${{ env.VERSION_SOURCES }}/ -x '${{ env.VERSION_SOURCES }}/.git*'
- name: Clone zip validator
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: julienloizelet/m2-extension-zip-validator
path: zip-validator
Expand All @@ -123,6 +114,7 @@ jobs:
php zip-validator/validate_m2_package.php ${{ env.VERSION_SOURCES }}.zip
- name: Create Tag ${{ github.event.inputs.tag_name }}
if: github.event.inputs.only_zip_for_marketplace != 'true'
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
Expand All @@ -135,12 +127,14 @@ jobs:
})
- name: Prepare release notes
if: github.event.inputs.only_zip_for_marketplace != 'true'
run: |
# Retrieve release body and remove ---
VERSION_RELEASE_NOTES=$(awk -v ver="[${{ env.VERSION_NUMBER }}]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/v${{ env.VERSION_NUMBER }})" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next} } p && NF' ${{ env.VERSION_SOURCES }}/CHANGELOG.md | sed ':a;N;$!ba;s/\n---/ /g')
echo "$VERSION_RELEASE_NOTES" >> CHANGELOG.txt
- name: Create release ${{ env.VERSION_NUMBER }}
if: github.event.inputs.only_zip_for_marketplace != 'true'
uses: softprops/action-gh-release@v1
with:
files: ${{ env.VERSION_SOURCES }}.zip
Expand All @@ -149,3 +143,11 @@ jobs:
tag_name: ${{ github.event.inputs.tag_name }}
draft: ${{ github.event.inputs.draft }}
prerelease: ${{ github.event.inputs.prerelease }}

- name: Save zip
if: github.event.inputs.only_zip_for_marketplace == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.VERSION_SOURCES }}.zip
path: ${{ env.VERSION_SOURCES }}.zip
retention-days: 60
8 changes: 4 additions & 4 deletions .github/workflows/static-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
php-version: '7.4'
- m2-version: '2.4.0'
php-version: '7.4'
- m2-version: '2.4.6'
php-version: '8.2'
- m2-version: '2.4.7'
php-version: '8.3'

name: Static test suite
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
Expand All @@ -42,15 +42,15 @@ jobs:

steps:
- name: Install Magento 2 with DDEV
uses: julienloizelet/magento2-ddev-installation@v2.1.1
uses: julienloizelet/magento2-ddev-installation@v3
with:
php_version: ${{ matrix.php-version }}
magento_version: ${{ matrix.m2-version }}
composer_auth: ${{ secrets.M2_COMPOSER_AUTH }}
magento_repository: "https://repo.magento.com/"

- name: Clone extension files
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: my-own-modules/${{ env.EXTENSION_PATH }}

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [1.1.1](https://github.com/crowdsecurity/magento-cs-extension/releases/tag/v1.1.1) - 2024-04-12
[_Compare with previous release_](https://github.com/crowdsecurity/magento-cs-extension/compare/v1.1.0...v1.1.1)


### Changed

- No change: released on marketplace to confirm compatibility with Magento 2.4.7 and PHP 8.3

---

## [1.1.0](https://github.com/crowdsecurity/magento-cs-extension/releases/tag/v1.1.0) - 2024-01-05
[_Compare with previous release_](https://github.com/crowdsecurity/magento-cs-extension/compare/v1.0.0...v1.1.0)

Expand Down
2 changes: 1 addition & 1 deletion Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class Constants extends CapiConstants
/** @var string The user agent suffix used to send request to CAPI */
public const USER_AGENT_SUFFIX = 'magento2';
/** @var string The last version of this module */
public const VERSION = 'v1.1.0';
public const VERSION = 'v1.1.1';
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "crowdsec/magento2-module-engine",
"description": "This Magento 2 module allows sharing threat signal and benefit from the CrowdSec's community blocklist.",
"type": "magento2-module",
"version": "1.1.0",
"version": "1.1.1",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
Expand Down
4 changes: 2 additions & 2 deletions doc/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ Tests must be run sequentially (`fullyParallel: false` in the `playwright.config
ddev get julienloizelet/ddev-crowdsec-php
cp .ddev/okaeli-add-on/magento2/custom_files/crowdsec/engine/docker-compose.override.yaml .ddev/docker-compose.override.yaml
ddev magento config:set crowdsec_engine/general/enrollment_key <YOUR_ENROLL_KEY>
cp .ddev/okaeli-add-on/magento2/custom_scripts/cronLaunch.php ${{ github.workspace }}/pub/cronLaunch.php
cp .ddev/okaeli-add-on/magento2/custom_scripts/crowdsec/engine/runActions.php ${{ github.workspace }}/pub/runActions.php
cp .ddev/okaeli-add-on/magento2/custom_scripts/cronLaunch.php pub/cronLaunch.php
cp .ddev/okaeli-add-on/magento2/custom_scripts/crowdsec/engine/runActions.php pub/runActions.php
ddev restart
ddev playwright-install
```
Expand Down

0 comments on commit 266a15a

Please sign in to comment.