Skip to content

Commit

Permalink
chore: fix ci and use codspeed (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind authored Sep 20, 2024
1 parent 77977d6 commit fd2be5b
Show file tree
Hide file tree
Showing 9 changed files with 381 additions and 90 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:
DEBUG: napi:*
APP_NAME: svgr-rs
MACOSX_DEPLOYMENT_TARGET: '10.13'
'on':
on:
push:
branches:
- main
Expand All @@ -26,7 +26,6 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-06-27
target: x86_64-unknown-linux-gnu

- name: Run Cargo Check
Expand Down Expand Up @@ -62,7 +61,6 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-06-27
target: x86_64-unknown-linux-gnu
- name: Run cargo test
run: cargo test -p svgr-rs
Expand All @@ -71,21 +69,20 @@ jobs:
fail-fast: false
matrix:
settings:
- host: macos-latest
- host: macos-13
target: x86_64-apple-darwin
build: |
yarn build
yarn build --target x86_64-apple-darwin
strip -x *.node
- host: windows-latest
build: yarn build
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
rustup default nightly-2023-06-27 &&
yarn build --target x86_64-unknown-linux-gnu &&
build: |
set -e
yarn build --target x86_64-unknown-linux-gnu
strip *.node
- host: macos-latest
target: aarch64-apple-darwin
Expand All @@ -94,7 +91,9 @@ jobs:
strip -x *.node
- host: windows-latest
target: aarch64-pc-windows-msvc
build: yarn build --target aarch64-pc-windows-msvc
build: |
rustup target add aarch64-pc-windows-msvc
yarn build --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
needs:
- cargo-test
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: codspeed-benchmarks

on:
# Run on pushes to the main branch
push:
branches:
- "main"
# Run on pull requests
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
bins: cargo-codspeed

- name: Build the benchmark target(s)
run: cargo codspeed build

- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: cargo codspeed run --package svgr-rs
Loading

0 comments on commit fd2be5b

Please sign in to comment.