Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Cross-lint for Mac, iOS and Windows #796

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,30 @@ jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-ios
steps:
- uses: actions/checkout@v1
- name: Add Rust target ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: Clippy lint without features
# Only test the core ash, ash-rewrite and ash-window crate, where features reside.
# The examples crate would otherwise enable all default features again,
# making this test moot.
run: cargo clippy -p ash -p ash-rewrite -p ash-window --no-default-features -- -D warnings
run: cargo clippy --target ${{ matrix.target }} -p ash -p ash-rewrite -p ash-window --no-default-features -- -D warnings
- name: Clippy lint with all features
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
# Examples don't compile for iOS currently due to lacking run_return()
if: ${{ matrix.target != 'aarch64-apple-ios' }}
run: cargo clippy --target ${{ matrix.target }} --workspace --all-targets --all-features -- -D warnings
- name: Clippy lint with default features
run: cargo clippy --workspace --all-targets -- -D warnings
# Examples don't compile for iOS currently due to lacking run_return()
if: ${{ matrix.target != 'aarch64-apple-ios' }}
run: cargo clippy --target ${{ matrix.target }} --workspace --all-targets -- -D warnings

docs:
name: Build-test docs
Expand Down
6 changes: 3 additions & 3 deletions generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub trait ConstantExt {
fn variant_ident(&self, enum_name: &str) -> Ident;
fn notation(&self) -> Option<&str>;
fn formatted_notation(&self) -> Option<Cow<'_, str>> {
static DOC_LINK: Lazy<Regex> = Lazy::new(|| Regex::new(r#"<<([\w-]+)>>"#).unwrap());
static DOC_LINK: Lazy<Regex> = Lazy::new(|| Regex::new(r"<<([\w-]+)>>").unwrap());
self.notation().map(|n| {
DOC_LINK.replace(
n,
Expand Down Expand Up @@ -2968,13 +2968,13 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
let mut has_lifetimes = definitions
.iter()
.filter_map(get_variant!(vkxml::DefinitionsElement::Struct))
.filter_map(|s| {
.filter(|&s| {
s.elements
.iter()
.filter_map(get_variant!(vkxml::StructElement::Member))
.any(|x| x.reference.is_some())
.then(|| name_to_tokens(&s.name))
})
.map(|s| name_to_tokens(&s.name))
.collect::<HashSet<Ident>>();
for def in &definitions {
match def {
Expand Down
Loading