Skip to content

Commit

Permalink
ci: Update github workflows (no-changelog)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 21, 2023
1 parent 48533ab commit e67ea11
Show file tree
Hide file tree
Showing 15 changed files with 365 additions and 263 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/check-documentation-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v2.4.0

- uses: actions/setup-node@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3.8.1
with:
node-version: 18.x
cache: 'pnpm'

- name: Setup pnpm store cache
uses: actions/cache@v3.3.1
with:
path: |
/home/runner/.pnpm-store
/github/home/.pnpm-store
key: pnpm-store-cache

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Build nodes-base
run: pnpm --filter @n8n/client-oauth2 --filter n8n-workflow --filter n8n-core --filter n8n-nodes-base build
Expand Down
122 changes: 14 additions & 108 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,121 +6,27 @@ on:
- master

jobs:
install-and-build:
runs-on: ubuntu-latest

timeout-minutes: 30

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Cache build artifacts
uses: actions/cache@v3
with:
path: |
/github/home/.cache
/github/home/.pnpm-store
./node_modules
./packages
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint

unit-test:
name: Unit tests
runs-on: ubuntu-latest
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}
build:
uses: ./.github/workflows/reusable-build.yml
with:
branch: master

- name: Restore cached build artifacts
uses: actions/cache@v3
with:
path: |
/github/home/.cache
/github/home/.pnpm-store
./node_modules
./packages
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint

- uses: pnpm/action-setup@v2.2.4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Test
run: pnpm test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: packages/@n8n/client-oauth2/coverage/cobertura-coverage.xml,packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
unit-tests:
needs: build
uses: ./.github/workflows/reusable-unit-tests.yml
with:
branch: master

lint:
name: Lint changes
runs-on: ubuntu-latest
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- name: Restore cached build artifacts
uses: actions/cache@v3
with:
path: |
/github/home/.cache
/github/home/.pnpm-store
./node_modules
./packages
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint

- uses: pnpm/action-setup@v2.2.4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Lint
env:
CI_LINT_MASTER: true
run: pnpm lint
needs: build
uses: ./.github/workflows/reusable-lint.yml
with:
branch: master

notify-on-failure:
name: Notify Slack on failure
runs-on: ubuntu-latest
needs: [unit-test, lint]
needs: [unit-tests, lint]
steps:
- name: Notify Slack on failure
uses: act10ns/slack@v2.0.0
Expand Down
114 changes: 98 additions & 16 deletions .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,127 @@ on:
- cron: '0 0 * * *'
workflow_dispatch:

env:
DB_MYSQLDB_PASSWORD: password
DB_POSTGRESDB_PASSWORD: password
DB_TABLE_PREFIX: test_
DB_POSTGRESDB_SCHEMA: alt_schema

jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}

timeout-minutes: 60
- uses: pnpm/action-setup@v2.4.0

env:
DB_MYSQLDB_PASSWORD: password
DB_POSTGRESDB_PASSWORD: password
- uses: actions/setup-node@v3.8.1
with:
node-version: 18.x

steps:
- uses: actions/checkout@v3
- name: Setup pnpm store cache
uses: actions/cache@v3.3.1
with:
path: |
/home/runner/.pnpm-store
/github/home/.pnpm-store
key: pnpm-store-cache

- name: Install dependencies
run: pnpm install --frozen-lockfile

- uses: pnpm/action-setup@v2.2.4
- name: Build Backend packages
run: pnpm --filter @n8n/client-oauth2 --filter n8n-workflow --filter n8n-core --filter n8n build

- uses: actions/setup-node@v3
- name: Cache build artifacts
uses: actions/cache/save@v3.3.1
with:
path: ./packages
key: build-db-${{ github.sha }}

test-mysql:
needs: build
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2.4.0

- name: Use Node.js 18.x
uses: actions/setup-node@v3.8.1
with:
node-version: 18.x
cache: 'pnpm'

- name: Setup pnpm store cache
uses: actions/cache@v3.3.1
with:
path: |
/home/runner/.pnpm-store
/github/home/.pnpm-store
key: pnpm-store-cache

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Start MySQL & Postgres
- name: Restore cached build artifacts
uses: actions/cache/restore@v3.3.1
with:
path: ./packages
key: build-db-${{ github.sha }}

- name: Start MySQL
uses: isbang/compose-action@v1.3.2
with:
compose-file: ./.github/docker-compose.yml

- name: Build Core, Workflow, and CLI
run: pnpm --filter @n8n/client-oauth2 --filter n8n-workflow --filter n8n-core --filter n8n build
services: mysql

- name: Test MySQL
working-directory: packages/cli
run: DB_TABLE_PREFIX=test_ pnpm test:mysql
run: pnpm test:mysql

test-postgres:
needs: build
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2.4.0

- name: Use Node.js 18.x
uses: actions/setup-node@v3.8.1
with:
node-version: 18.x

- name: Setup pnpm store cache
uses: actions/cache@v3.3.1
with:
path: |
/home/runner/.pnpm-store
/github/home/.pnpm-store
key: pnpm-store-cache

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore cached build artifacts
uses: actions/cache/restore@v3.3.1
with:
path: ./packages
key: build-db-${{ github.sha }}

- name: Start Postres
uses: isbang/compose-action@v1.3.2
with:
compose-file: ./.github/docker-compose.yml
services: postgres

- name: Test Postgres
working-directory: packages/cli
run: DB_POSTGRESDB_SCHEMA=alt_schema DB_TABLE_PREFIX=test_ pnpm test:postgres
run: pnpm test:postgres

notify-on-failure:
name: Notify Slack on failure
needs: [test-mysql, test-postgres]
runs-on: ubuntu-latest
steps:
- name: Notify Slack on failure
uses: act10ns/slack@v2.0.0
if: failure()
Expand Down
Loading

0 comments on commit e67ea11

Please sign in to comment.