Skip to content

Commit

Permalink
ci: include config_proc_macro crate in ci (#5389)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tommilligan authored Jun 21, 2022
1 parent 3de1a09 commit 2c8b3be
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 51 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,5 @@ jobs:
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}
- name: build
run: |
rustc -Vv
cargo -V
cargo build
env:
RUSTFLAGS: '-D warnings'

- name: test
run: cargo test
env:
RUSTFLAGS: '-D warnings'
- name: Build and Test
run: ./ci/build_and_test.sh
10 changes: 2 additions & 8 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,5 @@ jobs:
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}
- name: build
run: |
rustc -Vv
cargo -V
cargo build
- name: test
run: cargo test
- name: Build and Test
run: ./ci/build_and_test.sh
11 changes: 2 additions & 9 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ jobs:
if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
shell: bash

- name: build
run: |
rustc -Vv
cargo -V
cargo build
shell: cmd

- name: test
run: cargo test
- name: Build and Test
shell: cmd
run: ci\build_and_test.bat
14 changes: 14 additions & 0 deletions ci/build_and_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set "RUSTFLAGS=-D warnings"

:: Print version information
rustc -Vv || exit /b 1
cargo -V || exit /b 1

:: Build and test main crate
cargo build --locked || exit /b 1
cargo test || exit /b 1

:: Build and test other crates
cd config_proc_macro || exit /b 1
cargo build --locked || exit /b 1
cargo test || exit /b 1
18 changes: 18 additions & 0 deletions ci/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -euo pipefail

export RUSTFLAGS="-D warnings"

# Print version information
rustc -Vv
cargo -V

# Build and test main crate
cargo build --locked
cargo test

# Build and test other crates
cd config_proc_macro
cargo build --locked
cargo test
44 changes: 22 additions & 22 deletions config_proc_macro/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions config_proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub fn config_type(_args: TokenStream, input: TokenStream) -> TokenStream {
/// Used to conditionally output the TokenStream for tests that need to be run on nightly only.
///
/// ```rust
/// # use rustfmt_config_proc_macro::nightly_only_test;
///
/// #[nightly_only_test]
/// #[test]
/// fn test_needs_nightly_rustfmt() {
Expand All @@ -49,6 +51,8 @@ pub fn nightly_only_test(_args: TokenStream, input: TokenStream) -> TokenStream
/// Used to conditionally output the TokenStream for tests that need to be run on stable only.
///
/// ```rust
/// # use rustfmt_config_proc_macro::stable_only_test;
///
/// #[stable_only_test]
/// #[test]
/// fn test_needs_stable_rustfmt() {
Expand Down

0 comments on commit 2c8b3be

Please sign in to comment.