diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index f0a68d8b..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: 2 - -jobs: - build: - environment: - XCODE_SCHEME: test - XCODE_WORKSPACE: test - XCODE_PROJECT: test - NODE_VERSION: '10.2.1' - macos: - xcode: 8.3.3 - steps: - - checkout - - run: - name: Update submodules - command: git submodule update --init - - restore_cache: - key: node-{{ .Environment.NODE_VERSION }} - - restore_cache: - key: emsdk-{{ checksum "script/install-emscripten.sh" }} - - run: - name: Install Node.js with nvm - command: | - export NVM_DIR=${HOME}/.nvm - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash - [ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh" - nvm install ${NODE_VERSION} - nvm alias default ${NODE_VERSION} - echo "[ -s \"${NVM_DIR}/nvm.sh\" ] && . \"${NVM_DIR}/nvm.sh\"" >> $BASH_ENV - - run: - name: Install node dependencies - command: npm install - - run: - name: Build with emscripten - command: script/install-emscripten.sh - - save_cache: - key: node-{{ .Environment.NODE_VERSION }} - paths: - - .nvm - - save_cache: - key: emsdk-{{ checksum "script/install-emscripten.sh" }} - paths: - - .emscripten_cache - - emsdk-portable - - run: - name: Build emscripten - command: npm run build:browser - - run: - name: Lint JavaScript - command: npm run standard - - run: - name: Test Browser - command: npm run test:browser - - run: - name: Test Node.js - command: npm run test:node - - run: - name: Test native - command: npm run test:native diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..eb165d32 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + +jobs: + build: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: checkout + run: git submodule update --init + + - name: Install node dependencies + run: npm install + + - name: Build with emscripten + run: script/install-emscripten.sh + + - name: Build emscripten + run: npm run build:browser + + - name: Lint JavaScript + run: npm run standard + + - name: Test Browser + run: npm run test:browser + + - name: Test Node.js + run: npm run test:node + + - name: Test native + run: npm run test:native + diff --git a/.gitignore b/.gitignore index 51f142db..6887cce9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ build .clang_complete /browser.js -emsdk-portable +emsdk-1.39.16 package-lock.json +browser.wasm \ No newline at end of file diff --git a/script/build-browser-version.sh b/script/build-browser-version.sh index bb370e11..64f3011a 100755 --- a/script/build-browser-version.sh +++ b/script/build-browser-version.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source emsdk-portable/emsdk_env.sh +source emsdk-1.39.16/emsdk_env.sh mkdir -p build diff --git a/script/install-emscripten.sh b/script/install-emscripten.sh index 952cbcd4..d22ab23c 100755 --- a/script/install-emscripten.sh +++ b/script/install-emscripten.sh @@ -2,8 +2,8 @@ set -e -EMSCRIPTEN_DOWNLOAD_URL='https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz' -EMSDK_PATH="./emsdk-portable/emsdk" +EMSCRIPTEN_DOWNLOAD_URL='https://codeload.github.com/emscripten-core/emsdk/tar.gz/1.39.16' +EMSDK_PATH="./emsdk-1.39.16/emsdk" if [ ! -f $EMSDK_PATH ]; then echo 'Downloading emscripten SDK installer...' @@ -13,10 +13,10 @@ fi echo 'Installing emscripten SDK...' # Workaround https://github.com/juj/emsdk/pull/74 -sed -i{} "s_/kripken/emscripten/'_/kripken/emscripten'_" $EMSDK_PATH -sed -i{} "s_/WebAssembly/binaryen/'_/WebAssembly/binaryen'_" $EMSDK_PATH +#sed -i{} "s_/kripken/emscripten/'_/kripken/emscripten'_" $EMSDK_PATH +#sed -i{} "s_/WebAssembly/binaryen/'_/WebAssembly/binaryen'_" $EMSDK_PATH $EMSDK_PATH update -$EMSDK_PATH list -$EMSDK_PATH install sdk-1.37.9-64bit -$EMSDK_PATH activate sdk-1.37.9-64bit +$EMSDK_PATH list --old +$EMSDK_PATH install emscripten-1.37.9 +$EMSDK_PATH activate emscripten-1.37.9