Skip to content

Commit

Permalink
Merge pull request #37 from media-io/github_actions
Browse files Browse the repository at this point in the history
ci: add github actions CI
  • Loading branch information
MarcAntoine-Arnaud authored Jan 4, 2024
2 parents 214ab9b + 6c7b825 commit b064bb7
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches:
- main
pull_request:


jobs:

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75.0
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --workspace

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75.0
profile: minimal
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75.0
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features --workspace -- -D warnings

docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75.0
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --all-features --workspace --examples

2 changes: 1 addition & 1 deletion xml_schema_derive/src/xsd/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Element {
} else {
name
};

let attribute_name = Ident::new(&name, Span::call_site());
let yaserde_rename = &self.name;

Expand Down
6 changes: 3 additions & 3 deletions xml_schema_derive/src/xsd/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Implementation for Extension {
.map(|attribute| attribute.implement(namespace_definition, prefix, context))
.collect();

let inner_attribute = if format!("{rust_type}") == "String" {
let inner_attribute = if format!("{rust_type}") == "String" {
quote!(#[yaserde(text)])
} else {
TokenStream::new()
Expand Down Expand Up @@ -102,7 +102,7 @@ mod tests {
let expected = TokenStream::from_str(
r#"
#[yaserde(text)]
pub content: String,
pub base: String,
"#,
)
.unwrap();
Expand Down Expand Up @@ -145,7 +145,7 @@ mod tests {
let expected = TokenStream::from_str(
r#"
#[yaserde(text)]
pub content: String,
pub base: String,
#[yaserde(attribute)]
pub attribute_1: String,
#[yaserde(attribute)]
Expand Down
2 changes: 1 addition & 1 deletion xml_schema_derive/src/xsd/schema.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::xsd::{
use crate::xsd::{
attribute, attribute_group, complex_type, element, group, import, qualification, simple_type,
Implementation, XsdContext,
};
Expand Down

0 comments on commit b064bb7

Please sign in to comment.