Skip to content

Commit

Permalink
Merge pull request #525 from KodrAus/ci/wasm
Browse files Browse the repository at this point in the history
add more ci for wasm and embedded targets
  • Loading branch information
KodrAus committed Aug 12, 2021
2 parents c735394 + b0b6db4 commit dde80b2
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 112 deletions.
192 changes: 85 additions & 107 deletions .github/workflows/ci.yml
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
os_tests:
name: "Tests/OS: ${{ matrix.os }} - ${{ matrix.channel }}-${{ matrix.rust_target }}"
name: "Tests / OS: ${{ matrix.os }} - ${{ matrix.channel }}-${{ matrix.rust_target }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -29,7 +29,6 @@ jobs:
- stable
- beta
- nightly
- 1.34.0
os:
- macos-10.15
- windows-2019
Expand All @@ -50,110 +49,89 @@ jobs:
profile: minimal
toolchain: ${{ matrix.channel }}-${{ matrix.rust_target }}

- name: Build with --no-default-features
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- name: Test with --no-default-features
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features

- name: Build with --all-features
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Test with --all-features
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

- name: Build with default features
uses: actions-rs/cargo@v1
with:
command: build
- name: Test with default features
uses: actions-rs/cargo@v1
with:
command: test

- name: Build with --features guid
uses: actions-rs/cargo@v1
with:
command: build
args: --features guid
- name: Test with --features guid
uses: actions-rs/cargo@v1
with:
command: test
args: --features guid

- name: Build with --features serde
uses: actions-rs/cargo@v1
with:
command: build
args: --features serde
- name: Test with --features serde
uses: actions-rs/cargo@v1
with:
command: test
args: --features serde

- name: Build with --features slog
uses: actions-rs/cargo@v1
with:
command: build
args: --features slog
- name: Test with --features slog
uses: actions-rs/cargo@v1
- name: Install cargo-hack
run: cargo install cargo-hack

- name: Powerset
run: cargo hack test --feature-powerset --lib --optional-deps serde --depth 3

- name: Docs
run: cargo test --all-features --doc

msrv:
name: "Tests / MSRV / OS: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-10.15
- windows-2019
- ubuntu-20.04

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
command: test
args: --features slog
profile: minimal
toolchain: 1.46.0
override: true

- name: Default features
run: cargo test --features "v1 v3 v4 v5 serde"

wasm:
name: Tests / WebAssembly
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build with --features v1
uses: actions-rs/cargo@v1
with:
command: build
args: --features v1
- name: Test with --features serde
uses: actions-rs/cargo@v1
with:
command: test
args: --features v1

- name: Build with --features v3
uses: actions-rs/cargo@v1
with:
command: build
args: --features v3
- name: Test with --features v3
uses: actions-rs/cargo@v1
with:
command: test
args: --features v3

- name: Build with --features v4
uses: actions-rs/cargo@v1
with:
command: build
args: --features v4
- name: Test with --features v4
uses: actions-rs/cargo@v1
with:
command: test
args: --features v4

- name: Build with --features v5
uses: actions-rs/cargo@v1
with:
command: build
args: --features v5
- name: Test with --features v5
uses: actions-rs/cargo@v1
with:
command: test
args: --features v5
- name: Default features
run: wasm-pack test --node -- --features "wasm-bindgen v1 v3 v4 v5"

embedded:
name: Build / Embedded
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: thumbv6m-none-eabi
override: true

- name: Default features
uses: actions-rs/cargo@v1
with:
command: build
args: -Z avoid-dev-deps --target thumbv6m-none-eabi --no-default-features

nodeps:
name: Build / No deps
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Install cargo-hack
run: cargo install cargo-hack

- name: Powerset
run: cargo hack check --feature-powerset -Z avoid-dev-deps
10 changes: 7 additions & 3 deletions Cargo.toml
Expand Up @@ -39,9 +39,6 @@ default-target = "x86_64-pc-windows-msvc"
[package.metadata.playground]
features = ["serde", "v1", "v3", "v4", "v5"]

[badges.appveyor]
repository = "uuid-rs/uuid"

[badges.is-it-maintained-issue-resolution]
repository = "uuid-rs/uuid"

Expand Down Expand Up @@ -89,6 +86,13 @@ version = "1.0"
[dev-dependencies.serde_test]
version = "1.0.56"

[dev-dependencies.wasm-bindgen-lib]
package = "wasm-bindgen"
version = "0.2"

[dev-dependencies.wasm-bindgen-test]
version = "0.3"

[features]
default = ["std"]
guid = ["winapi"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@ uuid

[![Latest Version](https://img.shields.io/crates/v/uuid.svg)](https://crates.io/crates/uuid)
[![Join the chat at https://gitter.im/uuid-rs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uuid-rs/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.34.0+-yellow.svg)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.46.0+-yellow.svg)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/uuid-rs/uuid?branch=master&svg=true)](https://ci.appveyor.com/project/uuid-rs/uuid/branch/master)
[![Build Status](https://travis-ci.org/uuid-rs/uuid.svg?branch=master)](https://travis-ci.org/uuid-rs/uuid)
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Average time to resolve an issue")
Expand Down
1 change: 0 additions & 1 deletion src/adapter/compact.rs
Expand Up @@ -27,7 +27,6 @@ where

#[cfg(test)]
mod tests {

use serde_test;

#[test]
Expand Down

0 comments on commit dde80b2

Please sign in to comment.