|
5 | 5 | push:
|
6 | 6 | branches:
|
7 | 7 | - master
|
| 8 | + pull_request: |
8 | 9 | jobs:
|
9 | 10 | build:
|
10 | 11 | name: "Build with Emsdk:${{ matrix.emsdk }}"
|
|
40 | 41 | git config user.email "[email protected]"
|
41 | 42 | git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
42 | 43 | git fetch origin
|
43 |
| - git checkout "${GITHUB_REF:11}" |
| 44 | + if [ -z "$GITHUB_HEAD_REF" ]; then |
| 45 | + # If not a PR, undo detached head |
| 46 | + git checkout "${GITHUB_REF:11}" |
| 47 | + fi |
44 | 48 | git submodule update --init --remote --merge
|
45 | 49 | cd ./binaryen
|
46 | 50 | git log -n1
|
@@ -72,11 +76,23 @@ jobs:
|
72 | 76 | emcc --version
|
73 | 77 | emconfigure cmake .. -DCMAKE_BUILD_TYPE=Release
|
74 | 78 | emmake make -j2 binaryen_js
|
75 |
| - cp ./bin/binaryen_js.js ../../index.js |
| 79 | + cp ./bin/binaryen.js ../../index.js |
76 | 80 | cd ../..
|
77 | 81 | - name: "Test binaryen.js"
|
78 | 82 | run: |
|
79 | 83 | node ./tests/sanity
|
| 84 | + - name: "Build binaryen.wasm" |
| 85 | + run: | |
| 86 | + cd ./binaryen/build |
| 87 | + source $HOME/emsdk/emsdk_env.sh |
| 88 | + emcc --version |
| 89 | + emconfigure cmake .. -DCMAKE_BUILD_TYPE=Release |
| 90 | + emmake make -j2 binaryen_wasm |
| 91 | + cp ./bin/binaryen.js ../../wasm.js |
| 92 | + cd ../.. |
| 93 | + - name: "Test binaryen.wasm" |
| 94 | + run: | |
| 95 | + node ./tests/sanity --wasm |
80 | 96 | - name: "Build wasm-opt"
|
81 | 97 | run: |
|
82 | 98 | cd ./binaryen/build
|
|
91 | 107 | - name: "Push changes to GitHub"
|
92 | 108 | if: github.event_name != 'pull_request' && matrix.emsdk == 'latest-fastcomp'
|
93 | 109 | run: |
|
94 |
| - git add ./binaryen ./index.js ./bin/wasm-opt |
| 110 | + git add ./binaryen ./index.js ./wasm.js ./bin/wasm-opt |
95 | 111 | npm version $VERSION --no-git-tag-version --force
|
96 | 112 | if [ $RELEASE ]; then
|
97 | 113 | echo "Committing release ("$VERSION") ..."
|
|
0 commit comments