2020-06-13 17:09:45 +03:00
|
|
|
name: Integration tests
|
2020-05-28 16:23:53 +03:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
|
|
|
|
jobs:
|
2021-01-24 16:02:44 +03:00
|
|
|
publish-test:
|
|
|
|
name: node-api
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/
|
|
|
|
**/target/
|
|
|
|
key: ${{ runner.os }}-node-api-test
|
|
|
|
|
|
|
|
- name: Set platform name
|
|
|
|
run: |
|
|
|
|
export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())")
|
|
|
|
echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
npm config set prefix ~/npm
|
|
|
|
npm i
|
|
|
|
export PATH="$PATH:$HOME/npm/bin"
|
|
|
|
|
|
|
|
npm run build:dev
|
|
|
|
npm test
|
|
|
|
|
2020-05-28 16:23:53 +03:00
|
|
|
integration-test:
|
2021-01-24 16:02:44 +03:00
|
|
|
name: swc-cli
|
2020-05-28 16:23:53 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-01-11 13:39:17 +03:00
|
|
|
- uses: actions/setup-node@v2
|
2020-05-28 16:23:53 +03:00
|
|
|
with:
|
2021-01-11 13:39:17 +03:00
|
|
|
node-version: 14
|
2020-05-28 16:23:53 +03:00
|
|
|
|
2020-08-03 19:33:23 +03:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/
|
|
|
|
**/target/
|
|
|
|
key: ${{ runner.os }}-cargo-integration
|
|
|
|
|
2020-08-30 09:29:42 +03:00
|
|
|
- name: Set platform name
|
|
|
|
run: |
|
|
|
|
export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())")
|
2020-11-22 12:14:22 +03:00
|
|
|
echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV
|
2020-08-30 09:29:42 +03:00
|
|
|
shell: bash
|
|
|
|
|
2020-05-28 16:23:53 +03:00
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
npm config set prefix ~/npm
|
|
|
|
npm i
|
|
|
|
export PATH="$PATH:$HOME/npm/bin"
|
2020-08-30 09:29:42 +03:00
|
|
|
|
2020-09-18 20:07:28 +03:00
|
|
|
npm run build:dev
|
2021-01-18 17:00:53 +03:00
|
|
|
npm i -g @swc/cli@0.1.32
|
2020-05-28 16:23:53 +03:00
|
|
|
npm link
|
|
|
|
|
2020-07-01 10:31:55 +03:00
|
|
|
- name: (swc) three.js
|
2020-05-28 16:23:53 +03:00
|
|
|
run: |
|
|
|
|
export PATH="$PATH:$HOME/npm/bin"
|
|
|
|
mkdir -p integration-tests/three-js
|
|
|
|
npm i -g qunit failonlyreporter
|
|
|
|
|
|
|
|
# Download three.js
|
2020-08-03 19:33:23 +03:00
|
|
|
git clone --depth 1 https://github.com/mrdoob/three.js.git -b r117 integration-tests/three-js/repo
|
2020-05-28 16:23:53 +03:00
|
|
|
|
2021-01-18 17:00:53 +03:00
|
|
|
swc --sync --extensions '.js' integration-tests/three-js/repo/ -d integration-tests/three-js/build/
|
2020-05-28 16:23:53 +03:00
|
|
|
# swc integration-tests/three-js/repo/src/ -d integration-tests/three-js/repo/build/
|
|
|
|
# swc integration-tests/three-js/repo/test/unit/**/*.js -d integration-tests/three-js/repo/test/unit/build/
|
|
|
|
|
|
|
|
(cd integration-tests/three-js/build/test && qunit -r failonlyreporter unit/three.source.unit.js)
|
|
|
|
|
|
|
|
# terser: contains with statement in test
|
|
|
|
# Rome.js: I forgot the cause, but it didn't work.
|
|
|
|
# jQuery: browser only (window.document is required)
|
2020-07-01 10:31:55 +03:00
|
|
|
- name: (swc) redux
|
2020-05-28 16:23:53 +03:00
|
|
|
run: |
|
|
|
|
export PATH="$PATH:$HOME/npm/bin"
|
|
|
|
mkdir -p integration-tests/redux
|
|
|
|
npm i -g qunit failonlyreporter
|
|
|
|
|
|
|
|
# Download
|
|
|
|
git clone --depth 1 https://github.com/reduxjs/redux.git integration-tests/redux/repo
|
|
|
|
swc --sync integration-tests/redux/repo/src/ -d integration-tests/redux/repo/lib/
|
|
|
|
echo "module.exports=require('./index')" > integration-tests/redux/repo/lib/redux.js
|
|
|
|
swc --sync integration-tests/redux/repo/src/ -d integration-tests/redux/repo/test/
|
|
|
|
swc --sync integration-tests/redux/repo/test/ -d integration-tests/redux/repo/test/
|
|
|
|
|
|
|
|
(cd integration-tests/redux/repo && npm i)
|
|
|
|
(cd integration-tests/redux/repo && npx jest '.*.js' --modulePathIgnorePatterns 'typescript')
|
2020-08-06 08:55:16 +03:00
|
|
|
- name: (spack) example react app
|
|
|
|
run: |
|
|
|
|
export PATH="$PATH:$HOME/npm/bin"
|
|
|
|
(cd spack/integration-tests/react && npm i && npx spack)
|