Skip to content

Commit

Permalink
Add no-default-features yml workflow (#3053)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored May 23, 2024
1 parent 92ecfbd commit d06694a
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/no-default-features.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: no-default-features

on:
pull_request:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
branches:
- master

env:
RUSTFLAGS: -Dwarnings

jobs:
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 ${{ matrix.version }} && rustup default ${{ matrix.version }}-${{ matrix.target }}
- name: Add toolchain target
run: rustup target add ${{ matrix.target }}
- name: Fix environment
uses: ./.github/actions/fix-environment
- name: Check windows
run: cargo check -p windows --no-default-features
- name: Check windows-bindgen
run: cargo check -p windows-bindgen --no-default-features
- name: Check windows-core
run: cargo check -p windows-core --no-default-features
- name: Check windows-implement
run: cargo check -p windows-implement --no-default-features
- name: Check windows-interface
run: cargo check -p windows-interface --no-default-features
- name: Check windows-metadata
run: cargo check -p windows-metadata --no-default-features
- name: Check windows-registry
run: cargo check -p windows-registry --no-default-features
- name: Check windows-result
run: cargo check -p windows-result --no-default-features
- name: Check windows-sys
run: cargo check -p windows-sys --no-default-features
- name: Check windows-targets
run: cargo check -p windows-targets --no-default-features
- name: Check windows-version
run: cargo check -p windows-version --no-default-features
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = [
]

[workspace.lints.rust]
rust_2018_idioms = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
unused_qualifications = "warn"
missing_docs = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] }
49 changes: 49 additions & 0 deletions crates/tools/yml/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::fmt::Write;
fn main() {
test_yml();
clippy_yml();
no_default_features_yml();
}

fn test_yml() {
Expand Down Expand Up @@ -153,3 +154,51 @@ jobs:

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

fn no_default_features_yml() {
let mut yml = r"name: no-default-features
on:
pull_request:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
branches:
- master
env:
RUSTFLAGS: -Dwarnings
jobs:
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 ${{ matrix.version }} && rustup default ${{ matrix.version }}-${{ matrix.target }}
- name: Add toolchain target
run: rustup target add ${{ matrix.target }}
- name: Fix environment
uses: ./.github/actions/fix-environment"
.to_string();

for (name, _) in lib::crates("crates/libs") {
write!(
&mut yml,
r"
- name: Check {name}
run: cargo check -p {name} --no-default-features"
)
.unwrap();
}

std::fs::write(".github/workflows/no-default-features.yml", yml.as_bytes()).unwrap();
}

0 comments on commit d06694a

Please sign in to comment.