Skip to content

Commit 77212c1

Browse files
committed
Merge branch 'dev'
2 parents 0f630cd + a7e88bf commit 77212c1

File tree

113 files changed

+2393
-3159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2393
-3159
lines changed

.github/workflows/cross-platform.yml

+121-33
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Cross-platform CI
1+
name: CrossPlatform
22

33
on:
44
push:
@@ -7,78 +7,166 @@ on:
77
branches: [dev]
88

99
jobs:
10-
build-and-test:
10+
unit-testing:
11+
name: Unit testing
1112
strategy:
1213
matrix:
1314
include:
1415
# Linux targets
1516
- os: ubuntu-latest
16-
target: x86_64-unknown-linux-gnu
17-
# - os: ubuntu-latest
18-
# target: i686-unknown-linux-gnu
19-
# - os: ubuntu-latest
20-
# target: aarch64-unknown-linux-gnu
21-
17+
target: x86_64-unknown-linux-musl
2218
# Windows targets
2319
- os: windows-latest
2420
target: x86_64-pc-windows-msvc
2521
- os: windows-latest
2622
target: i686-pc-windows-msvc
27-
2823
# macOS targets
2924
- os: macos-14
3025
target: aarch64-apple-darwin
3126
- os: macos-13
3227
target: x86_64-apple-darwin
3328
fail-fast: false
34-
3529
runs-on: ${{ matrix.os }}
36-
3730
steps:
3831
- name: Checkout code
3932
uses: actions/checkout@v3
40-
4133
- name: Install Rust
4234
uses: actions-rs/toolchain@v1
4335
with:
44-
toolchain: nightly
4536
profile: minimal
4637
override: true
4738
target: ${{ matrix.target }}
48-
4939
- name: Run tests
50-
run: cargo test
40+
run: |
41+
cargo test --workspace --exclude e2e -- --nocapture
5142
env:
5243
RUST_BACKTRACE: full
44+
5345

46+
build-release:
47+
name: Build release
48+
needs: unit-testing
49+
strategy:
50+
matrix:
51+
include:
52+
# Linux targets
53+
- os: ubuntu-latest
54+
target: x86_64-unknown-linux-musl
55+
# Windows targets
56+
# - os: windows-latest
57+
# target: x86_64-pc-windows-msvc
58+
# - os: windows-latest
59+
# target: i686-pc-windows-msvc
60+
# macOS targets
61+
- os: macos-14
62+
target: aarch64-apple-darwin
63+
- os: macos-13
64+
target: x86_64-apple-darwin
65+
fail-fast: false
66+
runs-on: ${{ matrix.os }}
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v3
70+
- name: Install Rust
71+
uses: actions-rs/toolchain@v1
72+
with:
73+
profile: minimal
74+
override: true
75+
target: ${{ matrix.target }}
5476
- name: Build binary
5577
uses: actions-rs/cargo@v1
5678
with:
5779
command: build
5880
args: --verbose --release --target ${{ matrix.target }}
59-
81+
- name: Display binary size
82+
shell: bash
83+
run: |
84+
ls -l target/${{ matrix.target }}/release/*
85+
du -h target/${{ matrix.target }}/release/*
6086
- name: Strip binary (Linux and macOS only)
6187
if: matrix.os != 'windows-latest'
6288
run: |
63-
for file in snm node npm npx pnpm pnpx; do
89+
for file in snm node npm npx pnpm pnpx yarn; do
6490
strip "target/${{ matrix.target }}/release/$file"
6591
done
66-
coverage:
67-
name: Collect test coverage
68-
runs-on: ubuntu-latest
69-
env:
70-
CARGO_TERM_COLOR: always
92+
- name: Create Archive
93+
shell: bash
94+
run: |
95+
mkdir archive
96+
cp LICENSE README.md target/${{ matrix.target }}/release/{node,npm,npx,pnpm,pnpx,snm,yarn} archive/
97+
tar -czf ${{ matrix.target }}.tar.gz -C archive LICENSE README.md node npm npx pnpm pnpx snm yarn
98+
ls -l
99+
- name: Upload Artifacts tar.gz
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: ${{ matrix.target }}
103+
path: ${{ matrix.target }}.tar.gz
104+
105+
e2e-testing:
106+
name: E2E testing
107+
needs: build-release
108+
strategy:
109+
matrix:
110+
include:
111+
# Linux targets
112+
- os: ubuntu-latest
113+
target: x86_64-unknown-linux-musl
114+
# Windows targets
115+
- os: windows-latest
116+
target: x86_64-pc-windows-msvc
117+
- os: windows-latest
118+
target: i686-pc-windows-msvc
119+
# macOS targets
120+
- os: macos-14
121+
target: aarch64-apple-darwin
122+
- os: macos-13
123+
target: x86_64-apple-darwin
124+
fail-fast: false
125+
runs-on: ${{ matrix.os }}
71126
steps:
72-
- uses: actions/checkout@v4
127+
- name: Checkout code
128+
uses: actions/checkout@v3
73129
- name: Install Rust
74-
run: rustup update stable
75-
- name: Install cargo-llvm-cov
76-
uses: taiki-e/install-action@cargo-llvm-cov
77-
- name: Generate code coverage
78-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
79-
- name: Upload coverage to Codecov
80-
uses: codecov/codecov-action@v3
130+
uses: actions-rs/toolchain@v1
81131
with:
82-
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
83-
files: lcov.info
84-
fail_ci_if_error: true
132+
profile: minimal
133+
override: true
134+
target: ${{ matrix.target }}
135+
136+
- name: Download artifacts
137+
uses: actions/download-artifact@v4
138+
with:
139+
name: ${{ matrix.target }}
140+
path: .
141+
142+
- name: Tar downloaded files
143+
shell: bash
144+
run: |
145+
tar -xvf ${{ matrix.target }}.tar.gz -C e2e/tests
146+
cd e2e/tests
147+
ls -R
148+
- name: e2e tests
149+
shell: bash
150+
run: |
151+
cargo test --package e2e -- --nocapture
152+
153+
154+
# coverage:
155+
# name: Collect test coverage
156+
# runs-on: ubuntu-latest
157+
# env:
158+
# CARGO_TERM_COLOR: always
159+
# steps:
160+
# - uses: actions/checkout@v4
161+
# - name: Install Rust
162+
# run: rustup update stable
163+
# - name: Install cargo-llvm-cov
164+
# uses: taiki-e/install-action@cargo-llvm-cov
165+
# - name: Generate code coverage
166+
# run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
167+
# - name: Upload coverage to Codecov
168+
# uses: codecov/codecov-action@v3
169+
# with:
170+
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
171+
# files: lcov.info
172+
# fail_ci_if_error: true

.github/workflows/publish-github-release.yml .github/workflows/release.yml

+89-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
1-
name: Publish GitHub release
1+
name: Release
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8-
build-and-test:
8+
9+
unit-testing:
10+
name: Unit testing
11+
strategy:
12+
matrix:
13+
include:
14+
# Linux targets
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
# Windows targets
18+
- os: windows-latest
19+
target: x86_64-pc-windows-msvc
20+
- os: windows-latest
21+
target: i686-pc-windows-msvc
22+
# macOS targets
23+
- os: macos-14
24+
target: aarch64-apple-darwin
25+
- os: macos-13
26+
target: x86_64-apple-darwin
27+
fail-fast: false
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v3
32+
- name: Install Rust
33+
uses: actions-rs/toolchain@v1
34+
with:
35+
profile: minimal
36+
override: true
37+
target: ${{ matrix.target }}
38+
- name: Run tests
39+
run: |
40+
cargo test --workspace --exclude e2e -- --nocapture
41+
env:
42+
RUST_BACKTRACE: full
43+
44+
build:
45+
needs: unit-testing
946
strategy:
1047
matrix:
1148
include:
@@ -31,53 +68,40 @@ jobs:
3168
- os: macos-13
3269
target: x86_64-apple-darwin
3370
fail-fast: false
34-
3571
runs-on: ${{ matrix.os }}
36-
3772
steps:
3873
- name: Checkout Code
3974
uses: actions/checkout@v3
40-
4175
- name: Install Dependencies
4276
if: matrix.os == 'ubuntu-latest'
4377
run: |
4478
sudo apt-get update
4579
sudo apt-get install -y openssl pkg-config libssl-dev musl-tools
46-
4780
- name: Install Rust
4881
uses: actions-rs/toolchain@v1
4982
with:
5083
toolchain: nightly
5184
profile: minimal
5285
override: true
5386
target: ${{ matrix.target }}
54-
55-
- name: Run Tests
56-
run: cargo test
57-
env:
58-
RUST_BACKTRACE: full
59-
6087
- name: Build Binary
6188
uses: actions-rs/cargo@v1
6289
with:
6390
command: build
6491
args: --verbose --release --target ${{ matrix.target }}
65-
6692
- name: Strip Binary (Linux and macOS only)
6793
if: matrix.os != 'windows-latest'
6894
run: |
6995
for file in snm node npm npx pnpm pnpx yarn; do
7096
strip "target/${{ matrix.target }}/release/$file"
7197
done
72-
7398
- name: Create Archive
7499
shell: bash
75100
run: |
76101
mkdir archive
77102
cp LICENSE README.md target/${{ matrix.target }}/release/{node,npm,npx,pnpm,pnpx,snm,yarn} archive/
78103
tar -czf ${{ matrix.target }}.tar.gz -C archive LICENSE README.md node npm npx pnpm pnpx snm yarn
79104
ls -l
80-
81105
- name: Calculate SHA256 Checksum
82106
run: |
83107
echo "Calculating SHA256 for ${{ matrix.target }}.tar.gz..."
@@ -88,24 +112,69 @@ jobs:
88112
fi
89113
cat ${{ matrix.target }}.sha256
90114
shell: bash
91-
92115
- name: Upload Artifacts tar.gz
93116
uses: actions/upload-artifact@v4
94117
with:
95118
name: ${{ matrix.target }}
96119
path: ${{ matrix.target }}.tar.gz
97-
98120
- name: Upload Artifacts sha256
99121
uses: actions/upload-artifact@v4
100122
with:
101123
name: ${{ matrix.target }}.sha256
102124
path: ${{ matrix.target }}.sha256
125+
126+
e2e-testing:
127+
name: E2E testing
128+
needs: build
129+
strategy:
130+
matrix:
131+
include:
132+
# Linux targets
133+
- os: ubuntu-latest
134+
target: x86_64-unknown-linux-musl
135+
# Windows targets
136+
# - os: windows-latest
137+
# target: x86_64-pc-windows-msvc
138+
# - os: windows-latest
139+
# target: i686-pc-windows-msvc
140+
# macOS targets
141+
- os: macos-14
142+
target: aarch64-apple-darwin
143+
- os: macos-13
144+
target: x86_64-apple-darwin
145+
fail-fast: false
146+
runs-on: ${{ matrix.os }}
147+
steps:
148+
- name: Checkout code
149+
uses: actions/checkout@v3
150+
- name: Install Rust
151+
uses: actions-rs/toolchain@v1
152+
with:
153+
profile: minimal
154+
override: true
155+
target: ${{ matrix.target }}
156+
157+
- name: Download artifacts
158+
uses: actions/download-artifact@v4
159+
with:
160+
name: ${{ matrix.target }}
161+
path: .
162+
163+
- name: Tar downloaded files
164+
shell: bash
165+
run: |
166+
tar -xvf ${{ matrix.target }}.tar.gz -C e2e/tests
167+
cd e2e/tests
168+
ls -R
169+
- name: e2e tests
170+
run: |
171+
cargo test --package e2e -- --nocapture
103172
104173
105-
publish-github-release:
174+
publish:
106175
name: Publish To Github Release
107176
runs-on: ubuntu-latest
108-
needs: build-and-test
177+
needs: e2e-testing
109178
steps:
110179
- uses: actions/download-artifact@v4
111180
- name: Display structure of downloaded files
@@ -125,7 +194,7 @@ jobs:
125194
contents: write
126195
name: Generate And Upload Homebrew snm.rb File
127196
runs-on: ubuntu-latest
128-
needs: publish-github-release
197+
needs: publish
129198
steps:
130199
- uses: actions/download-artifact@v4
131200
with:

0 commit comments

Comments
 (0)