Skip to content

Commit 77cb6a3

Browse files
committed
chore(ci): switch to nightly toolchain for advanced formatting
1 parent 498660d commit 77cb6a3

File tree

5 files changed

+32
-27
lines changed

5 files changed

+32
-27
lines changed

.github/workflows/ci.yml

+19-21
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,39 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- uses: dtolnay/rust-toolchain@stable
17+
- uses: Swatinem/rust-cache@v2
1818
with:
19+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
20+
restore-keys: |
21+
${{ runner.os }}-cargo-
22+
23+
- uses: dtolnay/rust-toolchain@master
24+
with:
25+
toolchain: nightly-2024-10-01
1926
components: rustfmt, clippy
20-
targets: wasm32-unknown-unknown
2127

22-
- uses: Swatinem/rust-cache@v2
23-
2428
- name: Lint
2529
run: |
2630
cargo fmt -- --check
27-
cargo clippy --all-features -- -D warnings
31+
cargo clippy --all-features --locked -- -D warnings
2832
2933
test:
3034
runs-on: ubuntu-latest
3135
steps:
3236
- uses: actions/checkout@v4
3337

34-
- uses: dtolnay/rust-toolchain@stable
38+
- uses: Swatinem/rust-cache@v2
3539
with:
36-
toolchain: stable
40+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
41+
restore-keys: |
42+
${{ runner.os }}-cargo-
3743
38-
- uses: Swatinem/rust-cache@v2
44+
- uses: dtolnay/rust-toolchain@stable
45+
46+
- name: Install wasm32 target
47+
run: rustup target add wasm32-unknown-unknown
3948

4049
- name: Test
41-
run: cargo test --all-features
50+
run: cargo test --all-features --locked
51+
4252

43-
build:
44-
runs-on: ubuntu-latest
45-
needs: [lint, test]
46-
steps:
47-
- uses: actions/checkout@v4
48-
49-
- uses: dtolnay/rust-toolchain@stable
50-
51-
- uses: Swatinem/rust-cache@v2
52-
53-
- name: Build
54-
run: cargo build --release --all-features

Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,22 @@ all: check ## Run all development checks (default)
3131

3232
# Development setup
3333
.PHONY: setup
34-
setup: install-tools ## Set up development environment
34+
setup: install-tools install-wasm-target ## Set up development environment
3535
@echo "$(GREEN)Development environment setup complete!$(NC)"
3636

37-
.PHONY: install-tools
37+
.PHONY: install-tools
3838
install-tools: ## Install required development tools
3939
@echo "$(YELLOW)Installing required tools...$(NC)"
4040
@cargo install cargo-audit || (echo "$(RED)Failed to install cargo-audit$(NC)" && exit 1)
4141
@cargo install cargo-edit || (echo "$(RED)Failed to install cargo-edit$(NC)" && exit 1)
4242
@cargo install git-cliff || (echo "$(RED)Failed to install git-cliff$(NC)" && exit 1)
4343

44+
.PHONY: install-wasm-target
45+
install-wasm-target: ## Install wasm32-unknown-unknown target
46+
@echo "$(YELLOW)Installing wasm32-unknown-unknown target...$(NC)"
47+
@rustup target add wasm32-unknown-unknown || (echo "$(RED)Failed to install wasm32-unknown-unknown target$(NC)" && exit 1)
48+
49+
4450
# Development checks
4551
.PHONY: fmt
4652
fmt: ## Check code formatting

rust-toolchain

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nightly-2024-10-01

src/main.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ mod utils;
77
use cli::Cli;
88

99
#[tokio::main]
10+
#[allow(clippy::needless_return)]
1011
async fn main() {
11-
if let Err(e) = Cli::new().unwrap().execute().await {
12+
Cli::new().unwrap().execute().await.unwrap_or_else(|e| {
1213
eprintln!("Error: {}", e);
13-
std::process::exit(1);
14-
}
14+
std::process::exit(1)
15+
});
1516
}

tests/commands/rust/init_test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ fn test_init_fails_with_invalid_template() -> Result<(), Box<dyn std::error::Err
9494
}
9595

9696
#[test]
97-
#[ignore]
9897
fn test_init_creates_valid_project() -> Result<(), Box<dyn std::error::Error>> {
9998
let project = TestProject::new()?;
10099

0 commit comments

Comments
 (0)