Skip to content

Commit de1a4a0

Browse files
Max Lvclaude
authored andcommitted
Update dependencies to latest versions and add CI test workflow
- Replace deprecated structopt with clap v4 - Update webpki-roots to 1.0, env_logger to 0.11, dirs to 6.0 - Remove unused rustls-platform-verifier dependency - Fix clippy warnings in server.rs - Add unit tests for args parsing and common module - Add GitHub Actions CI workflow with test, clippy, and fmt checks - Update existing workflows to use actions/checkout@v4 and dtolnay/rust-toolchain Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
1 parent 32580a2 commit de1a4a0

File tree

9 files changed

+424
-390
lines changed

9 files changed

+424
-390
lines changed

.github/workflows/build-nightly.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ jobs:
1818
- aarch64-unknown-linux-musl
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust stable
24+
uses: dtolnay/rust-toolchain@stable
2225

2326
- name: Install cross
2427
run: cargo install cross
@@ -48,23 +51,18 @@ jobs:
4851
- x86_64-apple-darwin
4952
- aarch64-apple-darwin
5053
steps:
51-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v4
5255

5356
- name: Install GNU tar
5457
if: runner.os == 'macOS'
5558
run: |
5659
brew install gnu-tar
57-
# echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
5860
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
5961
6062
- name: Install Rust stable
61-
uses: actions-rs/toolchain@v1
63+
uses: dtolnay/rust-toolchain@stable
6264
with:
63-
profile: minimal
64-
toolchain: stable
65-
target: ${{ matrix.target }}
66-
default: true
67-
override: true
65+
targets: ${{ matrix.target }}
6866

6967
- name: Build release
7068
shell: bash
@@ -83,15 +81,10 @@ jobs:
8381
RUSTFLAGS: "-Ctarget-feature=+crt-static"
8482
RUST_BACKTRACE: full
8583
steps:
86-
- uses: actions/checkout@v2
84+
- uses: actions/checkout@v4
8785

8886
- name: Install Rust stable
89-
uses: actions-rs/toolchain@v1
90-
with:
91-
profile: minimal
92-
toolchain: stable
93-
default: true
94-
override: true
87+
uses: dtolnay/rust-toolchain@stable
9588

9689
- name: Build release
9790
run: |

.github/workflows/build-pr.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ jobs:
1919
- aarch64-unknown-linux-musl
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust stable
25+
uses: dtolnay/rust-toolchain@stable
2326

2427
- name: Install cross
2528
run: cargo install cross
@@ -43,23 +46,18 @@ jobs:
4346
- x86_64-apple-darwin
4447
- aarch64-apple-darwin
4548
steps:
46-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v4
4750

4851
- name: Install GNU tar
4952
if: runner.os == 'macOS'
5053
run: |
5154
brew install gnu-tar
52-
# echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
5355
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
5456
5557
- name: Install Rust stable
56-
uses: actions-rs/toolchain@v1
58+
uses: dtolnay/rust-toolchain@stable
5759
with:
58-
profile: minimal
59-
toolchain: stable
60-
target: ${{ matrix.target }}
61-
default: true
62-
override: true
60+
targets: ${{ matrix.target }}
6361

6462
- name: Build release
6563
shell: bash
@@ -72,22 +70,17 @@ jobs:
7270
RUSTFLAGS: "-Ctarget-feature=+crt-static"
7371
RUST_BACKTRACE: full
7472
steps:
75-
- uses: actions/checkout@v2
73+
- uses: actions/checkout@v4
7674

7775
- name: Install Rust stable
78-
uses: actions-rs/toolchain@v1
79-
with:
80-
profile: minimal
81-
toolchain: stable
82-
default: true
83-
override: true
76+
uses: dtolnay/rust-toolchain@stable
8477

8578
- name: Build release
8679
run: |
8780
pwsh ./build/build-host-release.ps1
8881
8982
- name: Upload Artifacts
90-
uses: actions/upload-artifact@v2
83+
uses: actions/upload-artifact@v4
9184
with:
9285
name: windows-native
9386
path: build/release/*

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
rust: [stable]
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install Rust ${{ matrix.rust }}
23+
uses: dtolnay/rust-toolchain@master
24+
with:
25+
toolchain: ${{ matrix.rust }}
26+
27+
- name: Cache cargo registry and build
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cargo/registry
32+
~/.cargo/git
33+
target
34+
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-cargo-${{ matrix.rust }}-
37+
38+
- name: Run tests
39+
run: cargo test --verbose
40+
41+
- name: Build
42+
run: cargo build --verbose
43+
44+
clippy:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install Rust stable
50+
uses: dtolnay/rust-toolchain@stable
51+
with:
52+
components: clippy
53+
54+
- name: Cache cargo registry and build
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
~/.cargo/registry
59+
~/.cargo/git
60+
target
61+
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
62+
restore-keys: |
63+
${{ runner.os }}-cargo-clippy-
64+
65+
- name: Run clippy
66+
run: cargo clippy -- -D warnings
67+
68+
fmt:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Install Rust stable
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
components: rustfmt
77+
78+
- name: Check formatting
79+
run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)