chore: Fix failing tests and improve CI scripts (#2563)

This commit is contained in:
Donny/강동윤 2021-10-28 11:55:49 +09:00 committed by GitHub
parent ac02f3f3fa
commit 7e29685a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 74 additions and 67 deletions

View File

@ -17,11 +17,14 @@ jobs:
./cache
~/.cargo/
target
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/Cargo.toml') }}
key: cargo-release-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-release-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build (release)
run: |
npm i
npm run build
yarn
yarn build
- name: Print binary size
run: ls -al ./target/release/libnode*
@ -31,6 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v1
with:
@ -38,7 +42,10 @@ jobs:
./cache
~/.cargo/
target
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/Cargo.toml') }}
key: cargo-bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Run benchmark
run: cargo bench --all | tee output.txt

View File

@ -81,7 +81,10 @@ jobs:
~/.cargo/
target
Cargo.lock
key: ${{ runner.os }}-cargo-v4
key: cargo-dev--${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-dev--${{ runner.os }}
# Ensure that all components are compilable.
- name: Run cargo check for all targets
run: cargo check --color always --all --all-targets
@ -220,13 +223,20 @@ jobs:
~/.cargo/
target
Cargo.lock
key: ${{ runner.os }}-cargo-v4
key: cargo-dev--${{ runner.os }}-${{ matrix.crate }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-dev--${{ runner.os }}-${{ matrix.crate }}
- name: Run cargo test
run: |
jest -v
cargo test --color always -p ${{ matrix.crate }}
- name: Run cargo test (swc_ecma_transforms)
if: matrix.crate == 'swc_ecma_transforms'
run: |
cargo test --color always -p swc_ecma_transforms --all-features
- name: Run cargo test (concurrent)
if: runner.os != 'Windows'
shell: bash
@ -237,7 +247,7 @@ jobs:
shell: bash
if: matrix.crate == 'swc'
run: |
./scripts/ci/test-concurrent.sh ${{ matrix.crate }}
cargo test --color always -p swc --features concurrent
deploy-docs:
name: Docs

View File

@ -1,54 +0,0 @@
name: Publish (wasm for web)
env:
CARGO_INCREMENTAL: 0
CI: "1"
on:
create:
tags:
- v*
jobs:
build:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Build - wasm for web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/
**/target/
key: ${{ runner.os }}-publish-integration
- name: Install node dependencies
run: npm i
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
run: (cd wasm && wasm-pack build --release --scope=swc --target web)
- name: Rename
run: |
sed -i'' -e 's/"name": "@swc\/wasm"/"name": "@swc\/wasm-web"/g' package.json
working-directory: wasm/pkg
- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
(cd wasm/pkg && npm publish --access public)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -10,10 +10,10 @@ on:
- v*
jobs:
build:
publish-node:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Build - wasm
name: Build - wasm for node.js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ -47,3 +47,46 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-web:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Build - wasm for web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/
**/target/
key: ${{ runner.os }}-publish-integration
- name: Install node dependencies
run: npm i
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
run: (cd wasm && wasm-pack build --release --scope=swc --target web)
- name: Rename
run: |
sed -i'' -e 's/"name": "@swc\/wasm"/"name": "@swc\/wasm-web"/g' package.json
working-directory: wasm/pkg
- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
(cd wasm/pkg && npm publish --access public)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -1,3 +0,0 @@
# .kodiak.toml
# Minimal config. version is the only required field.
version = 1

View File

@ -178,7 +178,8 @@
"end": 61,
"ctxt": 0
},
"value": "06c"
"value": "06c",
"raw": "06c"
}
],
"important": null

View File

@ -159,6 +159,7 @@ fn identity(entry: PathBuf) {
optional_chaining: true,
import_meta: true,
top_level_await: true,
private_in_object: true,
..Default::default()
}),
(&*js_fm).into(),

View File

@ -1,3 +1,5 @@
#![cfg(not(feature = "wrong-target"))]
use rayon::prelude::*;
use std::{
fs::create_dir_all,