Skip to content

Commit

Permalink
Add github CI (#2)
Browse files Browse the repository at this point in the history
* Add github CI

* Make clippy happy

* Make clippy happy

* Delete circle CI

* Add CI badge

* Fmt

* Fix tests and warnings

* Actually delete lockfile

* ignore Cargo.lock
  • Loading branch information
ascjones authored Mar 19, 2020
1 parent a9e8152 commit 6d06e56
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 183 deletions.
51 changes: 0 additions & 51 deletions .circleci/config.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Rust

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: setup
run: |
rustup install nightly-2020-03-11
rustup component add rustfmt --toolchain nightly-2020-03-11
rustup component add clippy --toolchain nightly-2020-03-11
- name: fmt
run: |
cargo +nightly-2020-03-11 fmt --version
cargo +nightly-2020-03-11 fmt --all -- --check
- name: clippy
run: |
cargo +nightly-2020-03-11 clippy --version
cargo +nightly-2020-03-11 clippy --all -- -D warnings
- name: build
run: |
cargo --version --verbose
cargo build --all
cargo build --all --no-default-features
- name: test
run: |
cargo test --all
- name: test no-std
run: |
cd ./test_suite/derive_tests_no_std
cargo +nightly-2020-03-11 build --no-default-features

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@

.vscode
.idea

# Remove Cargo.lock when creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Cargo.lock
119 changes: 0 additions & 119 deletions Cargo.lock

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# scale-info
#scale-info · ![build](https://github.com/paritytech/scale-info/workflows/Rust/badge.svg)

Info about [SCALE](https://github.com/paritytech/parity-scale-codec) encodable Rust types.

Expand Down
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ extern crate alloc;
/// ```
/// # use scale_info::tuple_meta_type;
/// assert_eq!(
/// tuple_meta_type!(i32, [u8; 32], String),
/// {
/// use scale_info::MetaType;
/// let mut vec = Vec::new();
/// vec.push(MetaType::new::<i32>());
/// vec.push(MetaType::new::<[u8; 32]>());
/// vec.push(MetaType::new::<String>());
/// vec
/// }
/// tuple_meta_type!(i32, [u8; 32], String),
/// {
/// use scale_info::MetaType;
/// let mut vec = Vec::new();
/// vec.push(MetaType::new::<i32>());
/// vec.push(MetaType::new::<[u8; 32]>());
/// vec.push(MetaType::new::<String>());
/// vec
/// }
/// );
/// ```
#[macro_export]
Expand Down
4 changes: 2 additions & 2 deletions test_suite/tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use alloc::{boxed::Box, vec};

use scale_info::{
tuple_meta_type, ClikeEnumVariant, EnumVariantStruct, EnumVariantTupleStruct, EnumVariantUnit, HasTypeDef,
HasTypeId, MetaType, Metadata, NamedField, Namespace, TypeDefClikeEnum, TypeDefEnum, TypeDefStruct,
TypeDefTupleStruct, TypeDefUnion, TypeId, TypeIdCustom, UnnamedField,
HasTypeId, Metadata, NamedField, Namespace, TypeDefClikeEnum, TypeDefEnum, TypeDefStruct, TypeDefTupleStruct,
TypeDefUnion, TypeId, TypeIdCustom, UnnamedField,
};

fn assert_type_id<T, E>(expected: E)
Expand Down
3 changes: 2 additions & 1 deletion test_suite/tests/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![allow(dead_code)]

#[cfg(not(feature = "std"))]
extern crate alloc;

#[cfg(not(feature = "std"))]
use alloc::{vec, vec::Vec};

use scale_info::{form::CompactForm, IntoCompact as _, Metadata, Registry, TypeDef, TypeId};
use serde::Serialize;
use serde_json::json;
use scale_info::{form::CompactForm, IntoCompact as _, Metadata, Registry, TypeDef, TypeId};

#[derive(Serialize)]
struct TypeIdDef {
Expand Down

0 comments on commit 6d06e56

Please sign in to comment.