Skip to content

Commit

Permalink
chore(ci): swc compat test
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Oct 26, 2023
1 parent adf8f45 commit fea6bc7
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 80 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/swc-compat-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: SWC Compat Test

on:
push:
branches:
- "*"
pull_request:
types: ["opened", "reopened", "synchronize"]

env:
CARGO_INCREMENTAL: 0
RUST_LOG: "debug"
DIFF: 0
RUST_MIN_STACK: 4194304
CARGO_TERM_COLOR: always

jobs:
wasm-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- run: pnpm build

- name: Upload Binary
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: wasm
path: |
target/**/*.wasm
test:
name: Test with ${{ matrix.swc_package }}
runs-on: ubuntu-latest
needs: wasm-build
strategy:
matrix:
swc_package:
- "@swc/[email protected]"
- "@swc/[email protected]"
- "@swc/[email protected]"
- "@swc/[email protected]"
- "@swc/[email protected]"
- "@swc/core@latest"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"

- uses: pnpm/action-setup@v2
with:
run_install: |
- args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm add -D --ignore-scripts ${{ matrix.swc_package }}

- uses: actions/download-artifact@v3
with:
name: wasm
path: target/

- run: pnpm test
47 changes: 5 additions & 42 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,57 +38,20 @@ jobs:
- run: cargo check --all-targets
- run: cargo test

node-test:
name: "@swc/core test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- uses: pnpm/action-setup@v2

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm i --ignore-scripts --frozen-lockfile
- run: pnpm build
- run: pnpm test

node-test-latest:
name: "@swc/core@latest test"
swc-test:
name: SWC test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- uses: pnpm/action-setup@v2

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
- uses: pnpm/action-setup@v2
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
run_install: |
- args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm add -D --ignore-scripts @swc/core@latest @swc/jest@latest
- run: pnpm build
- run: pnpm test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![npm](https://img.shields.io/npm/v/swc_mut_cjs_exports)](https://www.npmjs.com/package/swc_mut_cjs_exports)

[![Test](https://github.com/magic-akari/swc_mut_cjs_exports/actions/workflows/test.yml/badge.svg)](https://github.com/magic-akari/swc_mut_cjs_exports/actions/workflows/test.yml)
[![SWC Compat Test](https://github.com/magic-akari/swc_mut_cjs_exports/actions/workflows/swc-compat-test.yml/badge.svg)](https://github.com/magic-akari/swc_mut_cjs_exports/actions/workflows/swc-compat-test.yml)
[![with @swc/core@latest](https://github.com/magic-akari/swc_mut_cjs_exports/actions/workflows/cron.yml/badge.svg)](https://github.com/magic-akari/swc_mut_cjs_exports/actions/workflows/cron.yml)

This is a SWC plugin to emit mutable CJS exports.
Expand Down
87 changes: 49 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fea6bc7

Please sign in to comment.