-
Notifications
You must be signed in to change notification settings - Fork 18
67 lines (56 loc) · 1.98 KB
/
check-code.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Check Code
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- '**'
# Cancel running jobs from previous pipelines of the same workflow on PR to save resource when commits are pushed quickly
# NOTE: we don't want this behavior on default branch
# See https://stackoverflow.com/a/68422069
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('ci-default-branch-{0}-{1}', github.sha, github.workflow) || format('ci-pr-{0}-{1}', github.ref, github.workflow) }}
cancel-in-progress: true
jobs:
check-code:
name: Run Code Checks
# Disable usage of large runner on default branch of forks
# NOTE: temporarily disable large runner
# runs-on: ${{ (github.repository != 'finos/legend-studio' && github.ref == 'refs/heads/main') && 'ubuntu-latest' || 'ubuntu-latest-4-cores' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 20
- name: Install dependencies
run: |
npm install
npm install -g @vscode/vsce
- name: Run lint
run: npm run lint:ci
check-codebase-maintenance:
name: Run Codebase Maintenance Checks
# Disable usage of large runner on default branch of forks
# NOTE: temporarily disable large runners
# runs-on: ${{ (github.repository != 'finos/legend-studio' && github.ref == 'refs/heads/main') && 'ubuntu-latest' || 'ubuntu-latest-4-cores' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 20
- name: Install dependencies
run: |
npm install
npm install -g @vscode/vsce
- name: Check code formatting
run: npm run check:format
- name: Check copyright headers
run: npm run check:copyright