Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into use-smarty42
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Mar 6, 2024
2 parents c33e9ad + 9fb10ef commit 0846c96
Show file tree
Hide file tree
Showing 95 changed files with 4,976 additions and 4,551 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Auto-merge

on:
workflow_run:
workflows: [E2E testing for EC-CUBE]
types: [completed]

jobs:
check-and-merge:
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success'
permissions:
pull-requests: write
contents: write
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository with preceding commits
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Approve PR
run: gh pr review "$PR_URL" --approve
## いきなりマージするのが怖いので、一旦自動承認(↑)だけにする
#- name: Enable auto-merge
# run: gh pr merge --merge --auto "$PR_URL"

failed:
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'failure'
steps:
- name: failed
env:
WORKFLOW_RUN_CONTEXT: ${{ toJson(github.event.workflow_run) }}
# 失敗したときにデバッグ用に情報を出力しておく
run: |
echo "Haven't met the conditions to merge yet"
echo "$WORKFLOW_RUN_CONTEXT"
exit 1
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -105,10 +105,10 @@ jobs:
mv data/config/config.php.bak data/config/config.php
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ./coverage1.xml,./coverage2.xml,./coverage3.xml
# token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
flags: tests
# yml: ./codecov.yml
fail_ci_if_error: true
20 changes: 10 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ jobs:
- name: Checkout code
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout code
if: github.event_name == 'schedule' && env.DEPLOY == 1
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ env.TAG_NAME }}

Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
- name: Upload binaries to release of TGZ
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.tar.gz
Expand All @@ -189,7 +189,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of ZIP
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.zip
Expand All @@ -198,7 +198,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of TGZ md5 checksum
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.tar.gz.checksum.md5
Expand All @@ -207,7 +207,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of TGZ sha1 checksum
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.tar.gz.checksum.sha1
Expand All @@ -216,7 +216,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of TGZ sha256 checksum
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.tar.gz.checksum.sha256
Expand All @@ -225,7 +225,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of ZIP md5 checksum
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.zip.checksum.md5
Expand All @@ -234,7 +234,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of ZIP sha1 checksum
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.zip.checksum.sha1
Expand All @@ -243,7 +243,7 @@ jobs:
overwrite: true
- name: Upload binaries to release of ZIP sha256 checksum
if: env.DEPLOY == 1
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/${{ env.TAG_NAME }}.zip.checksum.sha256
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
echo "APT_SECURITY_REPO=security.debian.org" >> ${GITHUB_ENV}
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
## Used when creating multi-platform images
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
Expand All @@ -89,7 +89,7 @@ jobs:
run: echo "COMPOSE_FILE=docker-compose.yml:docker-compose.pgsql.yml:docker-compose.owaspzap.yml:docker-compose.owaspzap.daemon.yml" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -175,13 +175,13 @@ jobs:
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-evidence
path: 'test-results/'
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-logs
path: data/logs
34 changes: 16 additions & 18 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: E2E testing for EC-CUBE
run-name: E2E testing for EC-CUBE

on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
workflow_run:
workflows: [CI/CD for EC-CUBE]
types: [completed]

jobs:
run-on-linux:
name: Run on Linux
runs-on: ubuntu-22.04
if: |
github.event.workflow_run.conclusion == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -29,7 +25,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# - name: Create ADMIN_DIR
# run: |
Expand Down Expand Up @@ -72,19 +68,21 @@ jobs:

- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.tag }}-${{ matrix.db }}-evidence
path: 'test-results/'
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-${{ matrix.db }}-logs
path: data/logs
installer:
name: Installer test
runs-on: ubuntu-22.04
if: |
github.event.workflow_run.conclusion == 'success'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -155,7 +153,7 @@ jobs:
echo "APT_SECURITY_REPO=security.debian.org" >> ${GITHUB_ENV}
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup environment
env:
Expand Down Expand Up @@ -216,13 +214,13 @@ jobs:
run: yarn test:e2e e2e-tests/test/installer/installer.test.ts
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-${{ matrix.db }}-logs
path: html/install/temp/install.log*
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-${{ matrix.db }}-evidence
path: 'test-results/'
36 changes: 17 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
name: CI/CD for EC-CUBE
run-name: CI/CD for EC-CUBE

on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
workflow_run:
workflows: [PHPStan]
types: [completed]

jobs:
run-on-linux:
name: Run on Linux
runs-on: ${{ matrix.operating-system }}
if: |
github.event.workflow_run.conclusion == 'success'
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-20.04 ]
operating-system: [ ubuntu-22.04 ]
php: [ '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
db: [ mysql, pgsql ]
include:
Expand Down Expand Up @@ -61,13 +57,13 @@ jobs:
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -145,28 +141,30 @@ jobs:

- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-${{ matrix.db }}-logs
path: data/logs

run-on-windows:
name: Run on Windows
runs-on: ${{ matrix.operating-system }}
if: |
github.event.workflow_run.conclusion == 'success'
strategy:
fail-fast: false
matrix:
operating-system: [ windows-2022 ]
php: [ 5.5, 5.6, 7.1, 7.2, 7.3, 7.4 ]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**\composer.lock') }}
Expand Down Expand Up @@ -234,7 +232,7 @@ jobs:
data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: windows-php${{ matrix.php }}-${{ matrix.db }}-logs
path: data\logs
6 changes: 3 additions & 3 deletions .github/workflows/penetration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# - name: Create ADMIN_DIR
# run: |
Expand Down Expand Up @@ -75,14 +75,14 @@ jobs:
run: echo "ARTIFACT_NAME=$(echo ${GROUP} | sed 's,/,_,g')" >> $GITHUB_ENV
- name: Upload evidence
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: zap-${{ env.ARTIFACT_NAME}}-session
path: zap/sessions

- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-${{ matrix.db }}-logs
path: data/logs
Loading

0 comments on commit 0846c96

Please sign in to comment.