-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Cross-platform-next CI | ||
|
||
on: | ||
push: | ||
branches: [dev] | ||
pull_request: | ||
branches: [dev] | ||
|
||
jobs: | ||
unit-testing: | ||
name: Unit testing | ||
strategy: | ||
matrix: | ||
include: | ||
# Linux targets | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
# Windows targets | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
- os: windows-latest | ||
target: i686-pc-windows-msvc | ||
# macOS targets | ||
- os: macos-14 | ||
target: aarch64-apple-darwin | ||
- os: macos-13 | ||
target: x86_64-apple-darwin | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
- name: Run tests | ||
run: | | ||
cargo test --workspace --exclude e2e -- --nocapture | ||
env: | ||
RUST_BACKTRACE: full | ||
e2e-testing: | ||
name: E2E testing | ||
needs: unit-testing | ||
strategy: | ||
matrix: | ||
include: | ||
# Linux targets | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
# Windows targets | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
- os: windows-latest | ||
target: i686-pc-windows-msvc | ||
# macOS targets | ||
- os: macos-14 | ||
target: aarch64-apple-darwin | ||
- os: macos-13 | ||
target: x86_64-apple-darwin | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
- name: Build binary | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --verbose --release --target ${{ matrix.target }} | ||
- name: Strip binary (Linux and macOS only) | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
for file in snm node npm npx pnpm pnpx yarn; do | ||
strip "target/${{ matrix.target }}/release/$file" | ||
done | ||
- name: Move binary to e2e | ||
run: | | ||
mkdir -p artifacts | ||
mv target/${{ matrix.target }}/release/* e2e/tests | ||
- name: e2e tests | ||
run: | | ||
cargo test --package e2e -- --nocapture | ||
# coverage: | ||
# name: Collect test coverage | ||
# runs-on: ubuntu-latest | ||
# env: | ||
# CARGO_TERM_COLOR: always | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Install Rust | ||
# run: rustup update stable | ||
# - name: Install cargo-llvm-cov | ||
# uses: taiki-e/install-action@cargo-llvm-cov | ||
# - name: Generate code coverage | ||
# run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | ||
# files: lcov.info | ||
# fail_ci_if_error: true |