Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Nov 15, 2023
1 parent c52e89e commit 05f309c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:
if: "github.repository == 'graphql-rust/graphql-client'"
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Execute cargo test
run: cargo test --all --tests --examples
wasm_build:
Expand All @@ -36,13 +34,10 @@ jobs:
if: "github.repository == 'graphql-rust/graphql-client'"
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Execute cargo build
run: |
Expand All @@ -53,25 +48,22 @@ jobs:
if: "github.repository == 'graphql-rust/graphql-client'"
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: clippy,rustfmt
- name: Execute cargo fmt
run: cargo fmt --all -- --check
- name: Execute cargo clippy
run: cargo clippy --tests --examples -- -D warnings
run: cargo clippy --all --all-targets --all-features -- -D warnings
prettier:
name: Check prettier
runs-on: ubuntu-latest
if: "github.repository == 'graphql-rust/graphql-client'"
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install node.js
run: sudo apt update && sudo apt-get install -y nodejs
- name: Execute prettier
Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn generate_variables_struct(
variable
.r#type
.qualifiers
.get(0)
.first()
.map(|qual| !qual.is_required())
.unwrap_or(true),
query,
Expand Down
4 changes: 2 additions & 2 deletions graphql_client_codegen/src/codegen/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn calculate_selection<'a>(
})
.collect();

if let Some((selection_id, selection, _variant)) = variant_selections.get(0) {
if let Some((selection_id, selection, _variant)) = variant_selections.first() {
let mut variant_struct_name_str =
full_path_prefix(*selection_id, context.query);
variant_struct_name_str.reserve(2 + variant_name_str.len());
Expand Down Expand Up @@ -408,7 +408,7 @@ impl<'a> ExpandedField<'a> {
let optional_skip_serializing_none = if *options.skip_serializing_none()
&& self
.field_type_qualifiers
.get(0)
.first()
.map(|qualifier| !qualifier.is_required())
.unwrap_or(false)
{
Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl StoredInputFieldType {

pub(crate) fn is_optional(&self) -> bool {
self.qualifiers
.get(0)
.first()
.map(|qualifier| !qualifier.is_required())
.unwrap_or(true)
}
Expand Down

0 comments on commit 05f309c

Please sign in to comment.