prepare for new release (#3669) #7290
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Code | |
on: | |
push: | |
branches: | |
- master | |
- '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/master' && 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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.2.2 | |
- name: Get Yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Setup Yarn cache | |
uses: actions/cache@v4.1.2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}-yarn- | |
- name: Setup Node | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: 21 | |
- name: Install dependencies | |
run: yarn | |
# NOTE: we need this step to build the code before linting | |
- name: Check typings | |
run: yarn check:ts | |
- name: Run lint | |
run: yarn lint:ci | |
check-codebase-maintenance: | |
name: Run Codebase Maintenance Checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.2.2 | |
- name: Get Yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Setup Yarn cache | |
uses: actions/cache@v4.1.2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}-yarn- | |
- name: Setup Node | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: 21 | |
- name: Install dependencies | |
run: yarn | |
- name: Check package manifests | |
run: yarn check:pkg | |
- name: Check code formatting | |
run: yarn check:format | |
- name: Check copyright headers | |
run: yarn check:copyright | |
- name: Check code documentation | |
# We don't need this check when running the CI in the default branch | |
# since we already build the website there | |
if: github.ref != 'refs/heads/master' || github.repository != 'finos/legend-studio' | |
env: | |
# Typedoc build could consume a large amount of memory | |
# See https://github.com/TypeStrong/typedoc/issues/1606 | |
NODE_OPTIONS: '--max-old-space-size=4096' | |
run: yarn build:ts && yarn build:doc |