mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
91 lines
2.1 KiB
YAML
91 lines
2.1 KiB
YAML
name: Test Master
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
install-and-build:
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4.1.1
|
|
|
|
- run: corepack enable
|
|
- uses: actions/setup-node@v4.0.2
|
|
with:
|
|
node-version: 20.x
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Cache build artifacts
|
|
uses: actions/cache/save@v4.0.0
|
|
with:
|
|
path: ./packages/**/dist
|
|
key: ${{ github.sha }}-base:build
|
|
|
|
unit-test:
|
|
name: Unit tests
|
|
uses: ./.github/workflows/units-tests-reusable.yml
|
|
needs: install-and-build
|
|
strategy:
|
|
matrix:
|
|
node-version: [18.x, 20.x, 22.x]
|
|
with:
|
|
ref: ${{ inputs.branch }}
|
|
nodeVersion: ${{ matrix.node-version }}
|
|
cacheKey: ${{ github.sha }}-base:build
|
|
collectCoverage: true
|
|
|
|
lint:
|
|
name: Lint changes
|
|
runs-on: ubuntu-latest
|
|
needs: install-and-build
|
|
steps:
|
|
- uses: actions/checkout@v4.1.1
|
|
with:
|
|
repository: n8n-io/n8n
|
|
ref: ${{ inputs.branch }}
|
|
|
|
- run: corepack enable
|
|
- uses: actions/setup-node@v4.0.2
|
|
with:
|
|
node-version: 20.x
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Restore cached build artifacts
|
|
uses: actions/cache/restore@v4.0.0
|
|
with:
|
|
path: ./packages/**/dist
|
|
key: ${{ github.sha }}-base:build
|
|
|
|
- name: Lint
|
|
env:
|
|
CI_LINT_MASTER: true
|
|
run: pnpm lint
|
|
|
|
notify-on-failure:
|
|
name: Notify Slack on failure
|
|
runs-on: ubuntu-latest
|
|
needs: [unit-test, lint]
|
|
steps:
|
|
- name: Notify Slack on failure
|
|
uses: act10ns/slack@v2.0.0
|
|
if: failure()
|
|
with:
|
|
status: ${{ job.status }}
|
|
channel: '#alerts-build'
|
|
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
message: Master branch (build or test or lint) failed (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|