forked from farm-fe/farm
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (122 loc) · 3.79 KB
/
ci.yaml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: E2E Tests
on:
pull_request:
branches:
- main
jobs:
call-rust-build:
uses: ./.github/workflows/rust-build.yaml
examples-test:
name: Examples Test
runs-on: ${{ matrix.settings.os }}
needs: [call-rust-build]
strategy:
fail-fast: false
matrix:
settings:
- os: ubuntu-latest
abi: linux-x64-gnu
- os: macos-latest
abi: darwin-x64
- os: windows-latest
abi: win32-x64-msvc
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install -g pnpm && pnpm i --frozen-lockfile
- uses: actions/download-artifact@v3
id: download
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}
path: ./packages/core/binding
- uses: actions/download-artifact@v3
id: download-plugin-sass
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-sass
path: ./rust-plugins/sass/npm/${{ matrix.settings.abi }}
- uses: actions/download-artifact@v3
id: download-plugin-react
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-react
path: ./rust-plugins/react/npm/${{ matrix.settings.abi }}
- name: Test Examples - ${{ matrix.settings.abi }}
run: node scripts/test-examples.mjs
type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install -g pnpm && pnpm i --frozen-lockfile
- name: Type Check With Tsc
run: pnpm run --filter "@farmfe/*" type-check
ts-test:
name: Typescript Test
runs-on: ${{ matrix.settings.os }}
needs: call-rust-build
strategy:
fail-fast: false
matrix:
settings:
- os: ubuntu-latest
abi: linux-x64-gnu
- os: ubuntu-20.04
abi: linux-x64-gnu
- os: macos-latest
abi: darwin-x64
- os: windows-latest
abi: win32-x64-msvc
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install -g pnpm && pnpm i --frozen-lockfile
- uses: actions/download-artifact@v3
id: download
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}
path: ./packages/core/binding
- name: Test - ${{ matrix.settings.abi }}
run: npm run test -- --coverage
check-core-artifacts:
name: Check Core Artifacts
runs-on: ubuntu-latest
needs: call-rust-build
steps:
- uses: actions/download-artifact@v3
with:
path: /tmp/artifacts
- name: Check
run: |
for abi in linux-x64-gnu darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
test -f /tmp/artifacts/${{ github.sha }}-${abi}/farm.${abi}.node
done
check-plugin-artifacts:
name: Check ${{ matrix.settings.name }} Artifacts
runs-on: ubuntu-latest
needs: call-rust-build
strategy:
fail-fast: false
matrix:
settings:
- name: plugin-sass
- name: plugin-react
steps:
- uses: actions/download-artifact@v3
with:
path: /tmp/artifacts
- name: Check
run: |
for abi in linux-x64-gnu darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
test -f /tmp/artifacts/${{ github.sha }}-${abi}-${{ matrix.settings.name }}/index.farm
done