Bump serde from 1.0.218 to 1.0.219 #388
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: ["main"] | |
permissions: | |
issues: write | |
pull-requests: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Install Rust toolchain" | |
run: rustup show | |
- name: "Install cargo insta" | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-insta | |
- uses: Swatinem/rust-cache@v2 | |
- name: "Run tests" | |
run: cargo insta test --all --all-features --unreferenced reject | |
cargo-test-wasm: | |
runs-on: ubuntu-latest | |
name: "cargo test (wasm)" | |
steps: | |
- name: "Checkout PR branch" | |
uses: actions/checkout@v4 | |
with: | |
path: pr-branch | |
- name: "Checkout base branch" | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
path: base-branch | |
- name: "Install Rust toolchain" | |
run: rustup target add wasm32-unknown-unknown | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: qmaru/wasm-pack-action@v0.5.0 | |
- uses: Swatinem/rust-cache@v2 | |
- name: "Run wasm-pack test" | |
working-directory: ./pr-branch | |
run: | | |
wasm-pack test --node latex2mmlc_wasm | |
- name: "Get wasm size on PR" | |
working-directory: ./pr-branch | |
run: | | |
wasm-pack build --target web --out-dir ../playground/pkg --no-typescript --no-pack latex2mmlc_wasm | |
SIZE_BYTES=$(stat -c %s playground/pkg/latex2mmlc_wasm_bg.wasm) | |
echo "Wasm size on PR: $SIZE_BYTES bytes" | |
echo "PR_SIZE_BYTES=$SIZE_BYTES" >> $GITHUB_ENV | |
- name: "Get wasm size on base branch" | |
working-directory: ./base-branch | |
run: | | |
wasm-pack build --target web --out-dir ../playground/pkg --no-typescript --no-pack latex2mmlc_wasm | |
SIZE_BYTES=$(stat -c %s playground/pkg/latex2mmlc_wasm_bg.wasm) | |
echo "Wasm size on base: $SIZE_BYTES bytes" | |
echo "BASE_SIZE_BYTES=$SIZE_BYTES" >> $GITHUB_ENV | |
- name: "Comment on PR with WASM sizes" | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const prSize = process.env.PR_SIZE_BYTES; | |
const baseSize = process.env.BASE_SIZE_BYTES; | |
const sizeDiff = prSize - baseSize; | |
const sizeDiffPercent = (sizeDiff / baseSize) * 100; | |
const sizeDiffPercentStr = sizeDiffPercent.toFixed(2); | |
const sizeDiffStr = sizeDiff > 0 ? `+${sizeDiff}` : `${sizeDiff}`; | |
const comment = `Wasm size on PR: ${prSize} bytes\nWasm size on base branch: ${baseSize} bytes\nSize diff: ${sizeDiffStr} bytes (${sizeDiffPercentStr}%)`; | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: comment | |
}) |