Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Jul 11, 2024
1 parent e933eb9 commit e21b8ac
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 55 deletions.
44 changes: 13 additions & 31 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
APP_NAME: thanks-contributors
MACOSX_DEPLOYMENT_TARGET: "10.13"
RUST_BACKTRACE: full
NODE_VERSION: 16
NODE_VERSION: 20

on:
push:
Expand Down Expand Up @@ -39,18 +39,12 @@ jobs:
name: build-${{ matrix.target }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Setup rust target
run: rustup target add ${{ matrix.target }}
- name: Install dependencies
Expand All @@ -62,7 +56,7 @@ jobs:
if: ${{ matrix.strip }}
run: ${{ matrix.strip }} *.node
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.target }}
path: ${{ env.APP_NAME }}.*.node
Expand All @@ -72,18 +66,12 @@ jobs:
name: build-apple-silicon
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Setup rust target
run: rustup target add aarch64-apple-darwin
- name: Install dependencies
Expand All @@ -100,7 +88,7 @@ jobs:
- name: Strip debug symbols
run: strip -x *.node
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-aarch64-apple-darwin
path: ${{ env.APP_NAME }}.*.node
Expand Down Expand Up @@ -135,18 +123,12 @@ jobs:
runs-on: ubuntu-latest
container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: stable
- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
with:
Expand All @@ -166,7 +148,7 @@ jobs:
if: ${{ matrix.strip }}
run: ${{ matrix.strip }} *.node
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.target }}
path: ${{ env.APP_NAME }}.*.node
Expand All @@ -180,16 +162,16 @@ jobs:
- build-apple-silicon
- build-linux
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move artifacts
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -17,18 +18,8 @@ jobs:
fmt-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- uses: actions/checkout@v4
- name: rustfmt
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,28 @@ jobs:
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features
test-js:
name: Unit Tests - Node@${{ matrix.node }}
name: Unit Tests - Node ${{ matrix.node }}
strategy:
fail-fast: false
matrix:
node:
- "16"
- "18"
- "20"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Install dependencies
uses: ./.github/actions/yarn-install
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Build
run: yarn build
- name: Run Vitest
Expand Down

0 comments on commit e21b8ac

Please sign in to comment.