Skip to content

Commit a413ea9

Browse files
Rustify ci/build_and_test.* scripts (#6855)
* Split `ci/integration.rs` "common" code into another file * Migrate `build_and_test` scripts to Rust * Remove usage of `INTEGRATION` env variable * Update github actions scripts to use new rust binary * Make `-Dwarnings` mandatory when running `build-and-test` * Make `ci-integration` its own package to avoid rebuilding it * Make ci/target ignored path more precise
1 parent 8517e9a commit a413ea9

14 files changed

Lines changed: 190 additions & 165 deletions

.github/workflows/integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ jobs:
7474
7575
- name: run integration tests
7676
env:
77-
INTEGRATION: ${{ matrix.integration }}
7877
TARGET: x86_64-unknown-linux-gnu
79-
run: cargo run --bin ci-integration
78+
run: cargo run --manifest-path ci/Cargo.toml integration ${{ matrix.integration }}
8079
continue-on-error: ${{ matrix.allow-failure == true }}

.github/workflows/linux.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ jobs:
3636
rustup target add ${{ matrix.target }}
3737
3838
- name: Build and Test
39-
run: ./ci/build_and_test.sh
39+
env:
40+
RUSTFLAGS: -D warnings
41+
run: cargo run --manifest-path ci/Cargo.toml build-and-test

.github/workflows/mac.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ jobs:
3232
rustup target add ${{ matrix.target }}
3333
3434
- name: Build and Test
35-
run: ./ci/build_and_test.sh
35+
env:
36+
RUSTFLAGS: -D warnings
37+
run: cargo run --manifest-path ci/Cargo.toml build-and-test

.github/workflows/windows.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ jobs:
5858
shell: bash
5959

6060
- name: Build and Test
61-
shell: cmd
62-
run: ci\build_and_test.bat
61+
env:
62+
RUSTFLAGS: -D warnings
63+
run: cargo run --manifest-path ci/Cargo.toml build-and-test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# will have compiled files and executables
77
/target
88
tests/cargo-fmt/**/target
9+
/ci/target
910

1011
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
1112
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[package]
2-
32
name = "rustfmt-nightly"
43
version = "1.9.0"
54
description = "Tool to find and fix Rust formatting issues"
@@ -26,10 +25,6 @@ path = "src/format-diff/main.rs"
2625
name = "git-rustfmt"
2726
path = "src/git-rustfmt/main.rs"
2827

29-
[[bin]]
30-
name = "ci-integration"
31-
path = "ci/integration.rs"
32-
3328
[features]
3429
default = ["cargo-fmt", "rustfmt-format-diff"]
3530
cargo-fmt = []
@@ -74,4 +69,3 @@ tempfile = "3.23.0"
7469
[package.metadata.rust-analyzer]
7570
# This package uses #[feature(rustc_private)]
7671
rustc_private = true
77-

ci/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "ci-integration"
3+
version = "0.0.1"
4+
edition = "2024"
5+
publish = false
6+
7+
[workspace]

ci/build_and_test.bat

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

ci/build_and_test.sh

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

0 commit comments

Comments
 (0)