Skip to content

Commit

Permalink
ci: Automate more of the release process (no-changelog)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 21, 2024
1 parent 0276323 commit 9c98631
Show file tree
Hide file tree
Showing 14 changed files with 283 additions and 205 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
- edited
- synchronize
branches:
- '**'
- '!release/*'
- 'master'

jobs:
check-pr-title:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
pull_request_review:
types: [submitted]
branch:
branches:
- 'master'
paths:
- packages/design-system/**
Expand Down
108 changes: 6 additions & 102 deletions .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,113 +38,17 @@ jobs:
path: ./packages/**/dist
key: ${{ github.sha }}:db-tests

sqlite-pooled:
name: SQLite Pooled
runs-on: ubuntu-latest
needs: build
timeout-minutes: 20
env:
DB_TYPE: sqlite
DB_SQLITE_POOL_SIZE: 4
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}:db-tests

- name: Test SQLite Pooled
working-directory: packages/cli
run: pnpm jest

mysql:
name: MySQL
runs-on: ubuntu-latest
db-tests:
name: DB tests
uses: ./.github/workflows/db-tests-reusable.yml
needs: build
timeout-minutes: 20
env:
DB_MYSQLDB_PASSWORD: password
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}:db-tests

- name: Start MySQL
uses: isbang/compose-action@v2.0.0
with:
compose-file: ./.github/docker-compose.yml
services: |
mysql
- name: Test MySQL
working-directory: packages/cli
run: pnpm test:mysql --testTimeout 20000

postgres:
name: Postgres
runs-on: ubuntu-latest
needs: build
timeout-minutes: 20
env:
DB_POSTGRESDB_PASSWORD: password
DB_POSTGRESDB_POOL_SIZE: 1 # Detect connection pooling deadlocks
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}:db-tests

- name: Start Postgres
uses: isbang/compose-action@v2.0.0
with:
compose-file: ./.github/docker-compose.yml
services: |
postgres
- name: Test Postgres
working-directory: packages/cli
run: pnpm test:postgres
with:
cacheKey: ${{ github.sha }}:db-tests

notify-on-failure:
name: Notify Slack on failure
runs-on: ubuntu-latest
needs: [mysql, postgres]
needs: [db-tests]
steps:
- name: Notify Slack on failure
uses: act10ns/slack@v2.0.0
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build, unit test and lint branch

on: [pull_request]
on:
pull_request:
branches:
- '**'
- '!release/*'

jobs:
install-and-build:
Expand All @@ -9,7 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
with:
repository: n8n-io/n8n
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- run: corepack enable
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/db-tests-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Reusable DB test workflow

on:
workflow_call:
inputs:
cacheKey:
description: Cache key for build artifacts.
required: true
type: string

jobs:
sqlite-pooled:
name: SQLite Pooled
runs-on: ubuntu-latest
timeout-minutes: 20
env:
DB_TYPE: sqlite
DB_SQLITE_POOL_SIZE: 4
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ inputs.cacheKey }}

- name: Test SQLite Pooled
working-directory: packages/cli
run: pnpm jest

mysql:
name: MySQL
runs-on: ubuntu-latest
timeout-minutes: 20
env:
DB_MYSQLDB_PASSWORD: password
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ inputs.cacheKey }}

- name: Start MySQL
uses: isbang/compose-action@v2.0.0
with:
compose-file: ./.github/docker-compose.yml
services: |
mysql
- name: Test MySQL
working-directory: packages/cli
run: pnpm test:mysql --testTimeout 20000

postgres:
name: Postgres
runs-on: ubuntu-latest
timeout-minutes: 20
env:
DB_POSTGRESDB_PASSWORD: password
DB_POSTGRESDB_POOL_SIZE: 1 # Detect connection pooling deadlocks
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ inputs.cacheKey }}

- name: Start Postgres
uses: isbang/compose-action@v2.0.0
with:
compose-file: ./.github/docker-compose.yml
services: |
postgres
- name: Test Postgres
working-directory: packages/cli
run: pnpm test:postgres
5 changes: 0 additions & 5 deletions .github/workflows/docker-images-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- cron: '0 1 * * *'
workflow_dispatch:
inputs:
repository:
description: 'GitHub repository to create image off.'
required: true
default: 'n8n-io/n8n'
branch:
description: 'GitHub branch to create image off.'
required: true
Expand Down Expand Up @@ -49,7 +45,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
repository: ${{ github.event.inputs.repository || 'n8n-io/n8n' }}
ref: ${{ github.event.inputs.branch || 'master' }}

- name: Set up QEMU
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/docker-images.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/workflows/e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ on:
required: false
default: 'browsers:node18.12.0-chrome107'
type: string
cache-key:
description: 'Cache key for modules and build artifacts.'
required: false
default: ${{ github.sha }}-${{ inputs.run-env }}-e2e-modules
type: string
record:
description: 'Record test run.'
required: false
Expand Down Expand Up @@ -78,7 +73,6 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- name: Checkout PR
Expand Down Expand Up @@ -111,7 +105,7 @@ jobs:
/github/home/.cache
/github/home/.pnpm-store
./packages/**/dist
key: ${{ inputs.cache-key }}
key: ${{ github.sha }}-e2e

testing:
runs-on: ubuntu-latest
Expand All @@ -128,7 +122,6 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- name: Checkout PR
Expand All @@ -146,7 +139,7 @@ jobs:
/github/home/.cache
/github/home/.pnpm-store
./packages/**/dist
key: ${{ inputs.cache-key }}
key: ${{ github.sha }}-e2e

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: PR E2E
on:
pull_request_review:
types: [submitted]
branch:
branches:
- 'master'

concurrency:
Expand All @@ -18,7 +18,6 @@ jobs:
with:
pr_number: ${{ github.event.pull_request.number }}
user: ${{ github.event.pull_request.user.login || 'PR User' }}
spec: 'e2e/*'
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/linting-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
with:
repository: n8n-io/n8n
ref: ${{ inputs.ref }}

- run: corepack enable
Expand Down
Loading

0 comments on commit 9c98631

Please sign in to comment.