Skip to content

Commit c54a2ca

Browse files
authored
ci: transfer prep (#66)
1 parent a96e7b5 commit c54a2ca

10 files changed

+1872
-5066
lines changed

.github/workflows/build.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: main
8+
9+
env:
10+
WASI_VERSION: 12
11+
WASI_VERSION_FULL: "12.0"
12+
WABT_VERSION: "1.0.24"
13+
EMCC_VERSION: "1.40.1-fastcomp"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-18.04
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Prepare
23+
id: preparation
24+
run: |
25+
export PWD=$(pwd);
26+
echo "::set-output name=PROJ_ROOT::$PWD";
27+
28+
- name: Install
29+
run: npm install
30+
31+
- name: Install wasi-sdk
32+
env:
33+
PROJ_ROOT: ${{ steps.preparation.outputs.PROJ_ROOT }}
34+
run: |
35+
cd $PROJ_ROOT;
36+
cd ../;
37+
export WASI_OS="linux"
38+
curl -sL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-${WASI_OS}.tar.gz -O
39+
# check if package downloaded
40+
ls -la
41+
tar xvf wasi-sdk-${WASI_VERSION_FULL}-${WASI_OS}.tar.gz
42+
# print clang version
43+
./wasi-sdk-${WASI_VERSION_FULL}/bin/clang --version
44+
- name: Install wabt
45+
env:
46+
PROJ_ROOT: ${{ steps.preparation.outputs.PROJ_ROOT }}
47+
run: |
48+
cd $PROJ_ROOT;
49+
cd ../;
50+
if [[ "$RUNNER_OS" == "Linux" ]]; then
51+
export WABT_OS="ubuntu";
52+
fi
53+
if [[ "$RUNNER_OS" == "macOS" ]]; then
54+
export WABT_OS="macos";
55+
fi
56+
if [[ "$RUNNER_OS" == "Windows" ]]; then
57+
export WABT_OS="windows";
58+
fi
59+
curl -sL https://github.com/WebAssembly/wabt/releases/download/${WABT_VERSION}/wabt-${WABT_VERSION}-${WABT_OS}.tar.gz -O
60+
# check if package downloaded
61+
ls -la
62+
tar xvf wabt-${WABT_VERSION}-${WABT_OS}.tar.gz
63+
# check if wabt binaries installed
64+
ls -la ./wabt-${WABT_VERSION}/bin/
65+
- name: Compile to Wasm & Test Wasm
66+
env:
67+
PROJ_ROOT: ${{ steps.preparation.outputs.PROJ_ROOT }}
68+
run: |
69+
cd $PROJ_ROOT;
70+
rm lib/lexer.wasm;
71+
npm run build-wasm;
72+
npm run build;
73+
# test
74+
npm run test;
75+
- name: Benchmark Wasm
76+
env:
77+
PROJ_ROOT: ${{ steps.preparation.outputs.PROJ_ROOT }}
78+
run: |
79+
cd $PROJ_ROOT;
80+
npm run bench;

CODE_OF_CONDUCT.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Code of Conduct
2+
3+
cjs-module-lexer is committed to upholding the Node.js Code of Conduct.
4+
5+
The Node.js Code of Conduct document can be found at
6+
https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md

CONTRIBUTING.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Developer's Certificate of Origin 1.1
2+
3+
By making a contribution to this project, I certify that:
4+
5+
* (a) The contribution was created in whole or in part by me and I
6+
have the right to submit it under the open source license
7+
indicated in the file; or
8+
9+
* (b) The contribution is based upon previous work that, to the best
10+
of my knowledge, is covered under an appropriate open source
11+
license and I have the right under that license to submit that
12+
work with modifications, whether created in whole or in part
13+
by me, under the same open source license (unless I am
14+
permitted to submit under a different license), as indicated
15+
in the file; or
16+
17+
* (c) The contribution was provided directly to me by some other
18+
person who certified (a), (b) or (c) and I have not modified
19+
it.
20+
21+
* (d) I understand and agree that this project and the contribution
22+
are public and that a record of the contribution (including all
23+
personal information I submit with it, including my sign-off) is
24+
maintained indefinitely and may be redistributed consistent with
25+
this project or the open source license(s) involved.
26+
27+
## Moderation Policy
28+
29+
The [Node.js Moderation Policy] applies to this project.
30+
31+
[Node.js Moderation Policy]:
32+
https://github.com/nodejs/admin/blob/master/Moderation-Policy.md

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ lslib/lexer.wat: lib/lexer.wasm
33

44
lib/lexer.wasm: include-wasm/cjs-module-lexer.h src/lexer.c
55
@mkdir -p lib
6-
../wasi-sdk-11.0/bin/clang src/lexer.c -I include-wasm --sysroot=../wasi-sdk-11.0/share/wasi-sysroot -o lib/lexer.wasm -nostartfiles \
6+
../wasi-sdk-12.0/bin/clang src/lexer.c -I include-wasm --sysroot=../wasi-sdk-12.0/share/wasi-sysroot -o lib/lexer.wasm -nostartfiles \
77
-Wl,-z,stack-size=13312,--no-entry,--compress-relocations,--strip-all,--export=__heap_base,\
88
--export=parseCJS,--export=sa,--export=e,--export=re,--export=es,--export=ee,--export=rre,--export=ree,--export=res,--export=ru,--export=us,--export=ue \
99
-Wno-logical-op-parentheses -Wno-parentheses \

include/cjs-module-lexer.h

-108
This file was deleted.

0 commit comments

Comments
 (0)