mirror of
https://github.com/swc-project/swc.git
synced 2025-01-08 23:10:13 +03:00
chore: Fix failing tests and improve CI scripts (#2563)
This commit is contained in:
parent
ac02f3f3fa
commit
7e29685a17
15
.github/workflows/bench.yml
vendored
15
.github/workflows/bench.yml
vendored
@ -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
|
||||
|
||||
|
16
.github/workflows/cargo.yml
vendored
16
.github/workflows/cargo.yml
vendored
@ -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
|
||||
|
54
.github/workflows/publish-wasm-web.yml
vendored
54
.github/workflows/publish-wasm-web.yml
vendored
@ -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 }}
|
47
.github/workflows/publish-wasm.yml
vendored
47
.github/workflows/publish-wasm.yml
vendored
@ -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 }}
|
||||
|
@ -1,3 +0,0 @@
|
||||
# .kodiak.toml
|
||||
# Minimal config. version is the only required field.
|
||||
version = 1
|
@ -178,7 +178,8 @@
|
||||
"end": 61,
|
||||
"ctxt": 0
|
||||
},
|
||||
"value": "06c"
|
||||
"value": "06c",
|
||||
"raw": "06c"
|
||||
}
|
||||
],
|
||||
"important": null
|
||||
|
@ -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(),
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![cfg(not(feature = "wrong-target"))]
|
||||
|
||||
use rayon::prelude::*;
|
||||
use std::{
|
||||
fs::create_dir_all,
|
||||
|
Loading…
Reference in New Issue
Block a user