mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
d47ff48fb6
* ⚡ Sort CI steps by length * 🐛 `Build` before `test` for n8n packages
40 lines
928 B
YAML
40 lines
928 B
YAML
name: Test Pull Requests
|
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [14.x, 16.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
|
|
- name: Install npm and dependencies
|
|
run: npm install -g npm@latest && npm install
|
|
|
|
- name: Fetch base branch for `git diff`
|
|
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
|
|
|
|
- name: Run ESLint on changes only
|
|
env:
|
|
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }}
|
|
run: npm run lint
|
|
|
|
- name: Build
|
|
run: npm run build --if-present
|
|
|
|
- name: Test
|
|
run: npm run test
|