-
Notifications
You must be signed in to change notification settings - Fork 30
102 lines (83 loc) · 2.73 KB
/
Copy pathtest.yml
File metadata and controls
102 lines (83 loc) · 2.73 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
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/cli
steps:
- name: Checkout code
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Wix gateway proxy (mandatory)
uses: ./.github/actions/wix-gateway-proxy
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: .
- name: Build
run: bun run build
- name: Build binaries
run: bun run build:binaries
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dist
path: packages/cli/dist
test:
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runner: [npm, binary]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: packages/cli
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Wix gateway proxy (mandatory)
uses: ./.github/actions/wix-gateway-proxy
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
- name: Setup Bun
id: setup-bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ steps.setup-bun.outputs.bun-version }}-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-${{ steps.setup-bun.outputs.bun-version }}-
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
with:
deno-version: v2.x
- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: .
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: dist
path: packages/cli/dist
- name: Fix binary permissions
if: matrix.runner == 'binary' && runner.os != 'Windows'
run: chmod +x dist/binaries/*
- name: Run tests
run: bun run test:${{ matrix.runner }}