-
-
Notifications
You must be signed in to change notification settings - Fork 109
71 lines (59 loc) · 1.78 KB
/
build_and_test.yaml
File metadata and controls
71 lines (59 loc) · 1.78 KB
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
name: 🔨 Build & Test
on:
pull_request:
branches:
- 'main'
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
# github.actor!= 'github-actions' -> Ignore the pull request which comes from user depbot.
# github.repository_owner == 'aymericzip' -> Prevents the workflow from running on forks
if: ${{ github.repository_owner == 'aymericzip' && github.actor != 'github-actions' }}
name: 🔨 Build & Test
strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*]
bun-version: [1.3.10]
runs-on: ${{ matrix.os }}
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/checkout@v4
with:
token: ${{ env.GITHUB_TOKEN }}
fetch-depth: 0
- name: 🥡 Setup bun
id: setup-bun
uses: oven-sh/setup-bun@v2
with:
version: ${{ matrix.bun-version }}
run_install: false
- name: 🟢 Setup node
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 🔆 Cache bun modules
uses: actions/cache@v4
id: bun-cache
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-store-${{ hashFiles('**/bun.lock*') }}
restore-keys: |
${{ runner.os }}-bun-store-
- name: 🧩 Install Dependencies
id: install-dependencies
run: bun install
- name: 📝 Run linter
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: bun run lint-staged
- name: 🏗️ Build
id: build-the-mono-repo
run: |
bun build:ci
- name: 🧪 Test packages
run: bun run test