Skip to content

Commit

Permalink
ci(*): Update ci
Browse files Browse the repository at this point in the history
Add keepalive workflow
  • Loading branch information
julienloizelet committed Oct 9, 2024
1 parent 8398fb9 commit 42805b4
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 56 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/markdown.yml → .github/workflows/doc-links.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
name: Documentation links

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

name: Markdown files test and update
permissions:
contents: write
pull-requests: write
contents: read

jobs:
markdown-test-and-update:
name: Markdown files test and update
markdown-test-links:
name: Markdown test links
runs-on: ubuntu-latest
steps:

- name: Clone sources
uses: actions/checkout@v4
with:
Expand All @@ -32,12 +38,3 @@ jobs:
cd extension
awesome_bot --files README.md --allow-dupe --allow 401 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
awesome_bot doc/*.md --skip-save-results --allow-dupe --allow 401 --white-list ddev.site,repo.magento.com --base-url http://localhost:8080/doc/
- name: Generate table of contents
uses: technote-space/toc-generator@v4
with:
MAX_HEADER_LEVEL: 5
COMMIT_NAME: Okaeli Dev Bot
TARGET_PATHS: 'doc/*.md'
CHECK_ONLY_DEFAULT_BRANCH: true
CREATE_PR: true
17 changes: 8 additions & 9 deletions .github/workflows/end-to-end-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
paths-ignore:
- '**.md'
- "**.md"
workflow_dispatch:
inputs:
debug_enabled:
Expand All @@ -26,12 +26,12 @@ jobs:
matrix:
# Last 2 patches for the current minor, and last one for the previous minor, greatest php version
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.3.7"
php-version: "7.4"
- m2-version: "2.4.5"
php-version: "8.1"
- m2-version: "2.4.6"
php-version: "8.2"

name: End-to-end test suite
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
Expand All @@ -42,10 +42,9 @@ jobs:
EXTENSION_PATH: "category-code"

steps:

- name: Install Magento 2
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 }}
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/installation-and-varnish-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
paths-ignore:
- '**.md'
- "**.md"
workflow_dispatch:

permissions:
Expand All @@ -20,13 +20,12 @@ jobs:
fail-fast: false
matrix:
# Last one for the current and previous minor, greatest php version
m2-version: [ "2.3.7", "2.4.6" ]
php-version: [ "7.4", "8.2" ]
m2-version: ["2.3.7", "2.4.6"]
php-version: ["7.4", "8.2"]
exclude:
- { php-version: "8.2", m2-version: "2.3.7" }
- { php-version: "7.4", m2-version: "2.4.6" }


name: Installation and Varnish test suite
# @see https://devdocs.magento.com/marketplace/sellers/installation-and-varnish-tests.html
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,17 +60,18 @@ jobs:
ddev composer require ${{ env.EXTENSION_PACKAGE_NAME }}:@dev --no-interaction
- name: Installation tests
# chmod 777 to minimize chance to get the following error:
# The directory "/var/www/html/generated/code" cannot be deleted Warning!rmdir(/var/www/html/generated/code): Directory not empty
run: |
sudo chmod -R 777 ${{ github.workspace }}
rm -Rf ${{ github.workspace }}/generated
ddev magento maintenance:enable
ddev magento module:enable ${{ env.EXTENSION_NAME }}
ddev magento maintenance:disable
ddev magento setup:upgrade
ddev magento deploy:mode:set production
ddev magento indexer:reindex
# @see https://developer.adobe.com/commerce/marketplace/guides/sellers/installation-and-varnish-tests/#what-is-being-checked
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
shell: bash
command: |
ddev magento module:enable ${{ env.EXTENSION_NAME }}
ddev magento setup:upgrade
ddev magento setup:static-content:deploy -f
ddev magento deploy:mode:set production
ddev magento indexer:reindex
- name: Prepare for Varnish tests
run: |
Expand Down Expand Up @@ -250,4 +250,3 @@ jobs:
echo "Bad Varnish x-eqp-cache : ${VERIF}"
exit 1
fi
22 changes: 22 additions & 0 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Keep Alive
on:
schedule:
- cron: "0 3 * * 4"

permissions:
actions: write

jobs:
keep-alive:
name: Keep Alive
runs-on: ubuntu-latest

steps:
- name: Clone project files
uses: actions/checkout@v4

# keepalive-workflow keeps GitHub from turning off tests after 60 days
- uses: gautamkrishnar/keepalive-workflow@v2
with:
time_elapsed: 5
workflow_files: "end-to-end-test-suite.yml"
21 changes: 5 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
name: Create Release
# example: gh workflow run release.yml -f tag_name=v1.1.4 -f draft=false
# example: gh workflow run release.yml -f tag_name=v1.1.4
on:
workflow_dispatch:
inputs:
tag_name:
type: string
required: true
draft:
type: boolean
description: Draft release
default: false
prerelease:
type: boolean
description: Prerelease
default: false

jobs:
create-release:
Expand All @@ -25,7 +17,6 @@ jobs:
EXTENSION_ZIP_NAME: "okaeli-magento2-category-code"

steps:

- name: Check naming convention
run: |
VERIF=$(echo ${{ github.event.inputs.tag_name }} | grep -E "^v([0-9]{1,}\.)([0-9]{1,}\.)([0-9]{1,})$")
Expand Down Expand Up @@ -82,12 +73,10 @@ jobs:
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@v4
with:
Expand All @@ -100,7 +89,7 @@ jobs:
php zip-validator/validate_m2_package.php ${{ env.VERSION_SOURCES }}.zip
- name: Create Tag
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
Expand All @@ -117,11 +106,11 @@ jobs:
echo "$VERSION_RELEASE_NOTES" >> CHANGELOG.txt
- name: Create release ${{ env.VERSION_NUMBER }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ${{ env.VERSION_SOURCES }}.zip
body_path: CHANGELOG.txt
name: ${{ env.VERSION_NUMBER }}
tag_name: ${{ github.event.inputs.tag_name }}
draft: ${{ github.event.inputs.draft }}
prerelease: ${{ github.event.inputs.prerelease }}
draft: false
prerelease: false

0 comments on commit 42805b4

Please sign in to comment.