Skip to content

Commit

Permalink
Workflow improvements 2 (#2998)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Apr 16, 2024
1 parent 95dd4de commit a666eec
Show file tree
Hide file tree
Showing 15 changed files with 318 additions and 194 deletions.
430 changes: 281 additions & 149 deletions .github/workflows/clippy.yml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ env:
LLVM-MINGW-TOOLCHAIN-NAME: llvm-mingw-20220906-ucrt-ubuntu-18.04-x86_64

jobs:
test:
name: Test
check:
strategy:
matrix:
#
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/debugger_visualizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings --cfg windows_debugger_visualizer

jobs:
test:
name: Test
check:
runs-on: windows-2019

strategy:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
fmt:
name: Check
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
generation:
check:
name: tool_${{ matrix.tool }}
runs-on: ubuntu-latest
strategy:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
lib_generation:
name: Check
check:
runs-on: windows-2019
steps:
- name: Checkout
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
cargo_windows:
name: Check
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/raw_dylib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings --cfg windows_raw_dylib

jobs:
test:
name: Test
check:
runs-on: windows-2019

strategy:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
test:
name: Test
check:
runs-on: windows-2019

strategy:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows-bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
cargo_sys:
name: Check
check:
strategy:
matrix:
rust: [1.70.0, stable, nightly]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
cargo_sys:
name: Check
check:
strategy:
matrix:
rust: [1.70.0, stable, nightly]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows-sys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
cargo_sys:
name: Check
check:
strategy:
matrix:
rust: [1.60.0, stable, nightly]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
cargo_sys:
name: Check
check:
strategy:
matrix:
rust: [1.60.0, stable, nightly]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
cargo_windows:
name: Check
check:
strategy:
matrix:
rust: [1.62.0, stable, nightly]
Expand Down
44 changes: 24 additions & 20 deletions crates/tools/yml/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ env:
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Test
check:
runs-on: windows-2019
strategy:
Expand Down Expand Up @@ -88,7 +87,7 @@ jobs:
}

fn clippy_yml() {
let mut yml = r#"name: clippy
let mut yml = r"name: clippy
on:
pull_request:
Expand All @@ -102,34 +101,39 @@ env:
RUSTFLAGS: -Dwarnings
jobs:
cargo_clippy:
name: Check
check:
runs-on: windows-2019
strategy:
matrix:
include:
- version: nightly
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update toolchain
run: rustup update --no-self-update nightly && rustup default nightly-x86_64-pc-windows-msvc
run: rustup update --no-self-update ${{ matrix.version }} && rustup default ${{ matrix.version }}-${{ matrix.target }}
- name: Add toolchain target
run: rustup target add ${{ matrix.target }}
- name: Install clippy
run: rustup component add clippy
- name: Configure environment
shell: pwsh
run: |
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
(Join-Path $env:GITHUB_WORKSPACE "target\debug\deps").ToString() >> $env:GITHUB_PATH
(Join-Path $env:GITHUB_WORKSPACE "target\test\debug\deps").ToString() >> $env:GITHUB_PATH
"INCLUDE=C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" `
>> $env:GITHUB_ENV
- name: Run cargo clippy
run: |"#
- name: Fix environment
uses: ./.github/actions/fix-environment"
.to_string();

// This unrolling is required since "cargo clippy --all" consumes too much memory for the GitHub hosted runners.

for (name, _) in lib::crates("crates") {
write!(&mut yml, "\n cargo clippy -p {name} &&").unwrap();
write!(
&mut yml,
r"
- name: Clippy {name}
run: cargo clippy -p {name}"
)
.unwrap();
}

yml.truncate(yml.len() - 3);
std::fs::write(".github/workflows/clippy.yml", yml.as_bytes()).unwrap();
}

0 comments on commit a666eec

Please sign in to comment.