-
Notifications
You must be signed in to change notification settings - Fork 52
169 lines (142 loc) · 4.31 KB
/
integration.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Integration
on: [push, pull_request]
jobs:
integration:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install
- name: Build
run: yarn build
- name: Link
run: |
yarn link
- name: (swc + spack) three.js
shell: bash
run: |
checkBuild() {
SOURCE_JS_COUNT=$(find $1 -name "*.js" | wc -l)
BUILD_JS_COUNT=$(find $2 -name "*.js" | wc -l)
echo "Compare $1 to $2"
if [[ $SOURCE_JS_COUNT -ne $BUILD_JS_COUNT ]]
then
echo "File count do not match source count: ${SOURCE_JS_COUNT} to build ${BUILD_JS_COUNT}"
exit 1
fi
}
mkdir -p integration-tests/three.js
git clone --depth 1 https://github.com/mrdoob/three.js.git integration-tests/three.js
cd integration-tests/three.js
npm install @swc/core @swc/cli --save-dev
npm install
yarn link @swc/cli
tee .swcrc <<EOF
{
"jsc": {
"target": "es2019",
"parser": {
"syntax": "ecmascript",
"dynamicImport": true
}
},
"module": {
"type": "commonjs"
}
}
EOF
echo "Run swc sync"
rm -rf build
yarn swc --sync src -d build
checkBuild "src" "build"
rm -rf build-editor
yarn swc --sync editor -d ./build-editor/
checkBuild "editor" "build-editor"
echo "Run swc async"
rm -rf build
yarn swc src -d ./build/
checkBuild "src" "build"
rm -rf build-editor
yarn swc editor -d ./build-editor/
checkBuild "editor" "build-editor"
tee spack.config.js <<EOF
module.exports = {
entry: {
web: __dirname + "/src/Three.js",
},
output: {
path: __dirname + "/out",
},
};
EOF
echo "Run spack"
yarn spack
- name: (swc + spack) rxjs
shell: bash
run: |
checkBuild() {
SOURCE_JS_COUNT=$(find $1 -name "*.ts" -o -name '*.js' | wc -l)
BUILD_JS_COUNT=$(find $2 -name "*.js" | wc -l)
echo "Compare $1 to $2"
if [[ $SOURCE_JS_COUNT -ne $BUILD_JS_COUNT ]]
then
echo "File count do not match source count: ${SOURCE_JS_COUNT} to build ${BUILD_JS_COUNT}"
exit 1
fi
}
mkdir -p integration-tests/rxjs
git clone --depth 1 https://github.com/ReactiveX/rxjs.git integration-tests/rxjs
cd integration-tests/rxjs
npm install @swc/core @swc/cli --save-dev
npm install
yarn link @swc/cli
tee .swcrc <<EOF
{
"jsc": {
"target": "es2019",
"parser": {
"syntax": "typescript",
"dynamicImport": true
}
},
"module": {
"type": "commonjs"
}
}
EOF
echo "Run swc sync"
rm -rf build
yarn swc --sync src -d build
checkBuild "src" "build"
rm -rf build-spec
yarn swc --sync spec -d build-spec
checkBuild "spec" "build-spec"
rm -rf build
echo "Run swc async"
rm -rf build
yarn swc src -d build
checkBuild "src" "build"
rm -rf build-spec
yarn swc spec -d build-spec
checkBuild "spec" "build-spec"
tee spack.config.js <<EOF
module.exports = {
entry: {
web: __dirname + "/src/index.ts",
},
output: {
path: __dirname + "/out",
},
};
EOF
echo "Run spack"
yarn spack