-
-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (73 loc) · 2.33 KB
/
esy.yml
File metadata and controls
89 lines (73 loc) · 2.33 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Esy
on:
push:
branches: [main]
pull_request:
# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
env:
ESY__PREFIX: ${{ github.workspace }}/.esy/
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
check-latest: true
# Install `esy` to build the project
# It also adds `shx` globally for cross-platform shell commands
- name: Setup environment
run: |
npm i -g esy@0.9.2
npm i -g shx
- name: Checkout project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: Install local dependencies
run: |
esy install
- name: Esy cache
id: esy-cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: _export
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
- name: Import esy cache
if: steps.esy-cache.outputs.cache-hit == 'true'
run: |
esy import-dependencies _export
shx rm -rf _export
# Build the project in release to make sure deps are specified correctly
- name: Build release dependencies
if: steps.esy-cache.outputs.cache-hit != 'true'
run: |
esy build-dependencies --release
- name: Build project in release
run: |
esy build --release
# Then build in non-release so we can test
- name: Build dependencies
if: steps.esy-cache.outputs.cache-hit != 'true'
run: |
esy build-dependencies
- name: Build project
run: |
esy build
# Re-export dependencies if anything has changed or if it is the first time
- name: Build esy cache
if: steps.esy-cache.outputs.cache-hit != 'true'
run: |
esy export-dependencies
- name: Run tests
run: |
esy test