Skip to content

Commit 5433ff7

Browse files
committed
梳理 action 准备合并代码
1 parent 58e1665 commit 5433ff7

File tree

13 files changed

+288
-415
lines changed

13 files changed

+288
-415
lines changed

.github/workflows/cross-platform-n.yml

Lines changed: 0 additions & 186 deletions
This file was deleted.

.github/workflows/cross-platform.yml

Lines changed: 31 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -12,161 +12,51 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
# Linux targets
15+
# Linux targets (GNU)
1616
- os: ubuntu-latest
17-
target: x86_64-unknown-linux-musl
18-
# Windows targets
19-
- os: windows-latest
20-
target: x86_64-pc-windows-msvc
21-
- os: windows-latest
22-
target: i686-pc-windows-msvc
23-
# macOS targets
24-
- os: macos-14
25-
target: aarch64-apple-darwin
26-
- os: macos-13
27-
target: x86_64-apple-darwin
28-
fail-fast: false
29-
runs-on: ${{ matrix.os }}
30-
steps:
31-
- name: Checkout code
32-
uses: actions/checkout@v3
33-
- name: Install Rust
34-
uses: actions-rs/toolchain@v1
35-
with:
36-
profile: minimal
37-
override: true
38-
target: ${{ matrix.target }}
39-
- name: Run tests
40-
run: |
41-
cargo test --workspace --exclude e2e -- --nocapture
42-
env:
43-
RUST_BACKTRACE: full
44-
45-
46-
build-release:
47-
name: Build release
48-
needs: unit-testing
49-
strategy:
50-
matrix:
51-
include:
52-
# Linux targets
17+
target: x86_64-unknown-linux-gnu # 64位 Linux (GNU)
5318
- 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 }}
76-
- name: Build binary
77-
uses: actions-rs/cargo@v1
78-
with:
79-
command: build
80-
args: --verbose --release --target ${{ matrix.target }}
81-
- name: Display binary size
82-
shell: bash
83-
run: |
84-
ls -l target/${{ matrix.target }}/release/*
85-
du -h target/${{ matrix.target }}/release/*
86-
- name: Strip binary (Linux and macOS only)
87-
if: matrix.os != 'windows-latest'
88-
run: |
89-
for file in snm node npm npx pnpm pnpx yarn; do
90-
strip "target/${{ matrix.target }}/release/$file"
91-
done
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
19+
target: i686-unknown-linux-gnu # 32位 Linux (GNU)
20+
# Linux targets (MUSL)
21+
- os: ubuntu-latest
22+
target: x86_64-unknown-linux-musl # 64位 Linux (MUSL)
11223
- os: ubuntu-latest
113-
target: x86_64-unknown-linux-musl
114-
# Windows targets
24+
target: i686-unknown-linux-musl # 32位 Linux (MUSL)
25+
# Windows targets
11526
- os: windows-latest
116-
target: x86_64-pc-windows-msvc
27+
target: x86_64-pc-windows-msvc # 64位 Windows (MSVC)
11728
- os: windows-latest
118-
target: i686-pc-windows-msvc
119-
# macOS targets
29+
target: i686-pc-windows-msvc # 32位 Windows (MSVC)
30+
- os: windows-latest
31+
target: x86_64-pc-windows-gnu # 64位 Windows (MinGW)
32+
- os: windows-latest
33+
target: i686-pc-windows-gnu # 32位 Windows (MinGW)
34+
# macOS targets
12035
- os: macos-14
121-
target: aarch64-apple-darwin
36+
target: aarch64-apple-darwin # Apple Silicon Mac
12237
- os: macos-13
123-
target: x86_64-apple-darwin
38+
target: x86_64-apple-darwin # Intel Mac
12439
fail-fast: false
12540
runs-on: ${{ matrix.os }}
12641
steps:
12742
- name: Checkout code
12843
uses: actions/checkout@v3
44+
12945
- name: Install Rust
130-
uses: actions-rs/toolchain@v1
46+
uses: actions-rust-lang/setup-rust-toolchain@v1
13147
with:
132-
profile: minimal
13348
override: true
13449
target: ${{ matrix.target }}
13550

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
51+
- name: Run tests
52+
run: |
53+
cargo install just
54+
just setup
55+
cargo c --verbose
56+
cargo b --verbose
57+
cargo t
58+
cargo insta test -p e2e -- --nocapture
59+
# just ready
60+
# just ci-e2e
61+
env:
62+
RUST_BACKTRACE: full

0 commit comments

Comments
 (0)