generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 114
95 lines (92 loc) · 3.86 KB
/
check-build.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Check Build
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:
# This job is to make sure Webpack builds the application fine. This is helpful
# to know as we don't want to find out this failure as late as when we prepare the
# artifacts to publish to Docker.
application-build-check:
name: Check Application Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- application: '@finos/legend-application-studio-deployment'
os: ubuntu-latest
# NOTE: here we run a build on Windows just to check how the build process work for Windows
# developers. Setting up an OS matrix for all applications is unnecessary.
- application: '@finos/legend-application-studio-deployment'
os: windows-latest
- application: '@finos/legend-application-query-deployment'
os: ubuntu-latest
- application: '@finos/legend-application-pure-ide-deployment'
os: ubuntu-latest
- application: '@finos/legend-application-repl-deployment'
os: ubuntu-latest
- application: '@finos/legend-server-showcase-deployment'
os: ubuntu-latest
- application: '@finos/legend-vscode-extension-dependencies'
os: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
- name: Get Yarn cache directory path
if: matrix.os != 'windows-latest'
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Setup Yarn cache
if: matrix.os != 'windows-latest'
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-
enableCrossOsArchive: true
# NOTE: this is required since Windows machine uses powershell (pwsh)
# See https://github.com/actions/cache/issues/988
- name: Get Yarn cache directory path (Windows)
if: matrix.os == 'windows-latest'
id: yarn-cache-dir-path-windows
run: echo "dir=$(yarn config get cacheFolder)" >> ${env:GITHUB_OUTPUT}
- name: Setup Yarn cache (Windows)
if: matrix.os == 'windows-latest'
uses: actions/cache@v4.1.2
id: yarn-cache-windows
with:
path: ${{ steps.yarn-cache-dir-path-windows.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
enableCrossOsArchive: true
# NOTE: for windows runner, to avoid OOM issue, we set swap space
# See https://github.com/actions/runner/issues/1051
# See https://github.com/al-cheb/configure-pagefile-action
- name: Configure Pagefile (Windows)
if: matrix.os == 'windows-latest'
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 8GB
- name: Setup Node
uses: actions/setup-node@v4.1.0
with:
node-version: 21
- name: Install dependencies
run: yarn
- name: Build application
run: yarn build && yarn workspace ${{ matrix.application }} bundle
env:
# Webpack build could consume a large amount of memory
NODE_OPTIONS: '--max-old-space-size=4096'