mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
50e416d9ae
## Summary Autocancelling redundant CI jobs for `master` makes it harder to track health of `master`, in exchange for minor savings. Context: https://n8nio.slack.com/archives/C03MZF137FV/p1701771923477659?thread_ts=1699522038.290849&cid=C03MZF137FV ... #### How to test the change: 1. ... ## Issues fixed Include links to Github issue or Community forum post or **Linear ticket**: > Important in order to close automatically and provide context to reviewers ... ## Review / Merge checklist - [ ] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [ ] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. > > *(internal)* You can use Slack commands to trigger [e2e tests](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#a39f9e5ba64a48b58a71d81c837e8227) or [deploy test instance](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#f6a177d32bde4b57ae2da0b8e454bfce) or [deploy early access version on Cloud](https://www.notion.so/n8n/Cloudbot-3dbe779836004972b7057bc989526998?pvs=4#fef2d36ab02247e1a0f65a74f6fb534e).
102 lines
2.5 KiB
YAML
102 lines
2.5 KiB
YAML
name: Test Master
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 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.5.3
|
|
|
|
- uses: pnpm/action-setup@v2.4.0
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3.7.0
|
|
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/save@v3.3.1
|
|
with:
|
|
path: ./packages/**/dist
|
|
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
|
|
|
unit-test:
|
|
name: Unit tests
|
|
uses: ./.github/workflows/units-tests-reusable.yml
|
|
needs: install-and-build
|
|
strategy:
|
|
matrix:
|
|
node-version: [18.x, 20.x]
|
|
with:
|
|
ref: ${{ inputs.branch }}
|
|
nodeVersion: ${{ matrix.node-version }}
|
|
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
|
collectCoverage: true
|
|
|
|
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.5.3
|
|
with:
|
|
repository: n8n-io/n8n
|
|
ref: ${{ inputs.branch }}
|
|
|
|
- uses: pnpm/action-setup@v2.4.0
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3.7.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Restore cached build artifacts
|
|
uses: actions/cache/restore@v3.3.1
|
|
with:
|
|
path: ./packages/**/dist
|
|
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
|
|
|
- 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 }})
|