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

Set up GitHub Actions CI #10

Merged
merged 3 commits into from
May 11, 2021
Merged
Changes from 1 commit
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
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
pull_request:
branches:
- master
push:
branches:
- master

env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- run: cargo test --all-features --workspace

no-std:
strategy:
matrix:
target:
# TODO: Currently, valuable cannot build with targets that do not have atomic CAS.
# We should port https://github.com/rust-lang/futures-rs/pull/2400.
# - thumbv6m-none-eabi
Comment on lines +29 to +31
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix of this is in my other branch (be24a36), but it is bigger than this PR, so perhaps separate PR would be preferable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed #12

- thumbv7m-none-eabi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- run: rustup target add ${{ matrix.target }}
# TODO: Currently, valuable cannot build without `alloc` feature
# because `Debug` impl of `dyn Enumerable` uses `format!` macro.
Comment on lines +39 to +40
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly due to the following two lines.

let name = format!("{}::{}", self.name, variant.name());

let name = format!("{}::{}", self.name, variant.name());

@carllerche: Do you think it's ok to change it to print only variant name when alloc feature is disabled? (like the following)

#[cfg(feature = "alloc")]
let name = format!("{}::{}", self.name, variant.name());
#[cfg(not(feature = "alloc"))]
let name = variant.name();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah... we can probably tweak that. I'm fine w/ your proposal. Another PR 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed #11

# - run: cargo build --target ${{ matrix.target }} --no-default-features
# working-directory: valuable
# - run: cargo build --target ${{ matrix.target }} --no-default-features --features derive
# working-directory: valuable
- run: cargo build --target ${{ matrix.target }} --no-default-features --features alloc
working-directory: valuable
- run: cargo build --target ${{ matrix.target }} --no-default-features --features alloc,derive
working-directory: valuable

# TODO: Currently, valuable cannot build without `alloc` feature
# because `Debug` impl of `dyn Enumerable` uses `format!` macro.
# features:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install Rust
# run: rustup update stable
# - name: Install cargo-hack
# run: cargo install cargo-hack
# - run: cargo hack build --workspace --feature-powerset --no-dev-deps

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all -- --check