Skip to content

Commit 2c8b3be

Browse files
authored
ci: include config_proc_macro crate in ci (#5389)
* config_proc_macro: fix failing doctests * ci: include config_proc_macro crate in ci * [review] working native windows ci * [fix] add --locked file for ci * [fix] quoting of cmd variables
1 parent 3de1a09 commit 2c8b3be

File tree

7 files changed

+64
-51
lines changed

7 files changed

+64
-51
lines changed

.github/workflows/linux.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,5 @@ jobs:
3535
sh rustup-init.sh -y --default-toolchain none
3636
rustup target add ${{ matrix.target }}
3737
38-
- name: build
39-
run: |
40-
rustc -Vv
41-
cargo -V
42-
cargo build
43-
env:
44-
RUSTFLAGS: '-D warnings'
45-
46-
- name: test
47-
run: cargo test
48-
env:
49-
RUSTFLAGS: '-D warnings'
38+
- name: Build and Test
39+
run: ./ci/build_and_test.sh

.github/workflows/mac.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,5 @@ jobs:
3232
sh rustup-init.sh -y --default-toolchain none
3333
rustup target add ${{ matrix.target }}
3434
35-
- name: build
36-
run: |
37-
rustc -Vv
38-
cargo -V
39-
cargo build
40-
41-
- name: test
42-
run: cargo test
35+
- name: Build and Test
36+
run: ./ci/build_and_test.sh

.github/workflows/windows.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ jobs:
5757
if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
5858
shell: bash
5959

60-
- name: build
61-
run: |
62-
rustc -Vv
63-
cargo -V
64-
cargo build
65-
shell: cmd
66-
67-
- name: test
68-
run: cargo test
60+
- name: Build and Test
6961
shell: cmd
62+
run: ci\build_and_test.bat

ci/build_and_test.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
set "RUSTFLAGS=-D warnings"
2+
3+
:: Print version information
4+
rustc -Vv || exit /b 1
5+
cargo -V || exit /b 1
6+
7+
:: Build and test main crate
8+
cargo build --locked || exit /b 1
9+
cargo test || exit /b 1
10+
11+
:: Build and test other crates
12+
cd config_proc_macro || exit /b 1
13+
cargo build --locked || exit /b 1
14+
cargo test || exit /b 1

ci/build_and_test.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
export RUSTFLAGS="-D warnings"
6+
7+
# Print version information
8+
rustc -Vv
9+
cargo -V
10+
11+
# Build and test main crate
12+
cargo build --locked
13+
cargo test
14+
15+
# Build and test other crates
16+
cd config_proc_macro
17+
cargo build --locked
18+
cargo test

config_proc_macro/Cargo.lock

+22-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config_proc_macro/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pub fn config_type(_args: TokenStream, input: TokenStream) -> TokenStream {
2929
/// Used to conditionally output the TokenStream for tests that need to be run on nightly only.
3030
///
3131
/// ```rust
32+
/// # use rustfmt_config_proc_macro::nightly_only_test;
33+
///
3234
/// #[nightly_only_test]
3335
/// #[test]
3436
/// fn test_needs_nightly_rustfmt() {
@@ -49,6 +51,8 @@ pub fn nightly_only_test(_args: TokenStream, input: TokenStream) -> TokenStream
4951
/// Used to conditionally output the TokenStream for tests that need to be run on stable only.
5052
///
5153
/// ```rust
54+
/// # use rustfmt_config_proc_macro::stable_only_test;
55+
///
5256
/// #[stable_only_test]
5357
/// #[test]
5458
/// fn test_needs_stable_rustfmt() {

0 commit comments

Comments
 (0)