Skip to content

Commit

Permalink
Merge of #9047
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Sep 9, 2024
2 parents c7d0a09 + 555a803 commit fa34b7f
Show file tree
Hide file tree
Showing 77 changed files with 886 additions and 2,072 deletions.
45 changes: 45 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
queue_rules:
- name: default
allow_inplace_checks: false
queue_conditions:
- '#check-failure = 0'
- or:
- and:
- check-success ~= ci-slackbot-proxy-
- and:
- check-success ~= ci-app-
merge_conditions:
- '#check-failure = 0'
- or:
- and:
- check-success ~= ci-slackbot-proxy-
- and:
- check-success ~= ci-app-
- check-success ~= test-prod-node20 /

pull_request_rules:
- name: Automatic queue to merge
conditions:
- '#approved-reviews-by >= 1'
- '#review-requested = 0'
- check-success = "check-title"
actions:
queue:

- name: Automatic merge for Dependabot pull requests
conditions:
- author = dependabot[bot]
- '#approved-reviews-by >= 1'
- '#check-failure = 0'
- check-success = "check-title"
actions:
merge:
method: merge

- name: Automatic merge for Preparing next version
conditions:
- author = github-actions[bot]
- label = "type/prepare-next-version"
actions:
merge:
method: merge
4 changes: 3 additions & 1 deletion .github/workflows/auto-labeling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:

if: |
(!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' )
&& !startsWith( github.head_ref, 'changeset-release/' ))
&& !startsWith( github.head_ref, 'changeset-release/' )
&& !startsWith( github.head_ref, 'mergify/merge-queue/' ))
steps:
- uses: release-drafter/release-drafter@v5
Expand All @@ -36,6 +37,7 @@ jobs:
if: |
(!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' )
&& !startsWith( github.head_ref, 'changeset-release/' )
&& !startsWith( github.head_ref, 'mergify/merge-queue/' )
&& !startsWith( github.head_ref, 'dependabot/' ))
steps:
Expand Down
36 changes: 14 additions & 22 deletions .github/workflows/ci-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- dev/7.*.x
- dev/6.*.x
paths:
- .github/mergify.yml
- .github/workflows/ci-app-prod.yml
- .github/workflows/reusable-app-prod.yml
- .github/workflows/reusable-app-reg-suit.yml
Expand All @@ -24,6 +25,7 @@ on:
- dev/6.*.x
types: [opened, reopened, synchronize]
paths:
- .github/mergify.yml
- .github/workflows/ci-app-prod.yml
- .github/workflows/reusable-app-prod.yml
- .github/workflows/reusable-app-reg-suit.yml
Expand All @@ -34,12 +36,6 @@ on:
- apps/app/**
- '!apps/app/docker/**'
- packages/**
workflow_call:
inputs:
cypress-config-video:
description: 'Enable video when running Cypress test'
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -62,25 +58,21 @@ jobs:
with:
node-version: 20.x
skip-e2e-test: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
cypress-report-artifact-name-prefix: cypress-report-
cypress-config-video: ${{ inputs.cypress-config-video || false }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

# run-reg-suit-node20:
# needs: [test-prod-node20]

run-reg-suit-node20:
needs: [test-prod-node20]
# uses: weseek/growi/.github/workflows/reusable-app-reg-suit.yml@master

uses: weseek/growi/.github/workflows/reusable-app-reg-suit.yml@master
# if: always()

if: always()

with:
node-version: 20.x
skip-reg-suit: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
cypress-report-artifact-name-pattern: cypress-report-*
secrets:
REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# with:
# node-version: 20.x
# skip-reg-suit: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
# secrets:
# REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
1 change: 1 addition & 0 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- rc/**
- changeset-release/**
paths:
- .github/mergify.yml
- .github/workflows/ci-app.yml
- .eslint*
- tsconfig.base.json
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-slackbot-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- rc/**
- support/prepare-v**
paths:
- .github/mergify.yml
- .github/workflows/ci-slackbot-proxy.yml
- .eslint*
- tsconfig.base.json
Expand Down Expand Up @@ -175,6 +176,9 @@ jobs:


ci-slackbot-proxy-launch-prod:

if: startsWith(github.head_ref, 'mergify/merge-queue/')

runs-on: ubuntu-latest

strategy:
Expand Down
147 changes: 1 addition & 146 deletions .github/workflows/reusable-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
type: string
skip-e2e-test:
type: boolean
cypress-report-artifact-name-prefix:
type: string
cypress-config-video:
type: boolean
default: false
secrets:
SLACK_WEBHOOK_URL:
required: true
Expand Down Expand Up @@ -201,150 +196,10 @@ jobs:
url: ${{ secrets.SLACK_WEBHOOK_URL }}



run-cypress:
needs: [build-prod]

if: ${{ !inputs.skip-e2e-test }}

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# List string expressions that is comma separated ids of tests in "test/cypress/integration"
spec-group: ['21', '50']

services:
mongodb:
image: mongo:6.0
ports:
- 27017/tcp
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
ports:
- 9200/tcp
env:
discovery.type: single-node

steps:
- uses: actions/checkout@v4

- name: Install fonts
run: sudo apt install fonts-noto

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install turbo
run: |
yarn global add turbo
- name: Prune repositories
run: |
turbo prune @growi/app
rm -rf apps packages
mv out/* .
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
**/node_modules
# saved key by build-prod
key: node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
- name: Cache/Restore Cypress files
uses: actions/cache@v4
with:
path: |
~/.cache/Cypress
key: deps-for-cypress-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
deps-for-cypress-${{ runner.OS }}-node${{ inputs.node-version }}-
- name: Install dependencies
run: |
yarn global add node-gyp
yarn --frozen-lockfile
yarn cypress install
- name: Download production files artifact
uses: actions/download-artifact@v4
with:
name: Production Files (node${{ inputs.node-version }})

- name: Extract procution files artifact
run: |
tar -xf ${{ needs.build-prod.outputs.PROD_FILES }}
- name: Determine spec expression
id: determine-spec-exp
run: |
SPEC=`node bin/github-actions/generate-cypress-spec-arg.mjs --prefix="test/cypress/e2e/" --suffix="-*/*.cy.{ts,tsx}" "${{ matrix.spec-group }}"`
echo "value=$SPEC" >> $GITHUB_OUTPUT
- name: Copy dotenv file for ci
working-directory: ./apps/app
run: |
cat config/ci/.env.local.for-ci >> .env.production.local
- name: Copy dotenv file for automatic installation
if: ${{ matrix.spec-group != '10' }}
working-directory: ./apps/app
run: |
cat config/ci/.env.local.for-auto-install >> .env.production.local
- name: Copy dotenv file for automatic installation with allowing guest mode
if: ${{ matrix.spec-group == '21' }}
working-directory: ./apps/app
run: |
cat config/ci/.env.local.for-auto-install-with-allowing-guest >> .env.production.local
- name: Cypress Run
uses: cypress-io/github-action@v6
with:
browser: chromium
working-directory: ./apps/app
spec: '${{ steps.determine-spec-exp.outputs.value }}'
install: false
start: yarn server
wait-on: 'http://localhost:3000'
config: video=${{ inputs.cypress-config-video }}
env:
MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi-vrt
ELASTICSEARCH_URI: http://localhost:${{ job.services.elasticsearch.ports['9200'] }}/growi

- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.cypress-report-artifact-name-prefix }}${{ matrix.spec-group }}
path: |
apps/app/test/cypress/screenshots
apps/app/test/cypress/videos
- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Node CI for growi - run-cypress (${{ inputs.node-version }})*'
channel: '#ci'
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}



run-playwright:
needs: [build-prod]

if: ${{ !inputs.skip-e2e-test }}
if: ${{ !inputs.skip-e2e-test && startsWith(github.head_ref, 'mergify/merge-queue/') }}

runs-on: ubuntu-latest
container:
Expand Down
24 changes: 0 additions & 24 deletions .mergify.yml

This file was deleted.

2 changes: 0 additions & 2 deletions apps/app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/out/

# test
test/cypress/screenshots
test/cypress/videos
.reg

# dist
Expand Down
30 changes: 0 additions & 30 deletions apps/app/cypress.config.ts

This file was deleted.

Loading

0 comments on commit fa34b7f

Please sign in to comment.