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

Release v0.11 beta 7 #12

Merged
merged 8 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
74 changes: 29 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: Build

on:
push:
branches: [ master ]
branches:
- master
tags:
- 'v[0-9]+\.*'
pull_request:
branches: [ master ]
branches:
- master
- develop
- 'v[0-9]+.[0-9]+'

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,70 +20,48 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# NOTE: Dont use nix here everything should be based on the ubuntu-latest
- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Latest Ubuntu build check
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --workspace
no-default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Latest Ubuntu build check no features
run: nix develop .#stable -c cargo check --workspace --no-default-features
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --workspace --no-default-features
features:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature:
- serde
feature: [ fs, serde ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Check feature ${{ matrix.feature }} only
run: nix develop .#stable -c cargo check --no-default-features --features=${{ matrix.feature }}
- name: Check feature ${{ matrix.feature }} with defaults
run: nix develop .#stable -c cargo check --features=${{ matrix.feature }}
- uses: dtolnay/rust-toolchain@stable
- name: Feature ${{matrix.feature}}
run: cargo check --workspace --no-default-features --features=${{matrix.feature}}
- name: Feature ${{matrix.feature}}
run: cargo check --workspace --features=${{matrix.feature}}
platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ]
os: [ ubuntu-22.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest ]
steps:
- uses: actions/checkout@v4
# NOTE: Don't use nix in platform checks - everything should be based on the host system
- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build with all features
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-targets --all-features
- uses: dtolnay/rust-toolchain@stable
- name: Platform ${{matrix.os}}
run: cargo check --workspace --all-features # we skip test targets here to be sure that the main library can be built
toolchains:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [ nightly, beta, stable, msrv ]
toolchain: [ nightly, beta, stable, 1.76.0 ]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Check rgb-interfaces
run: nix develop ".#${{ matrix.toolchain }}" -c cargo check --workspace --all-targets --all-features
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.toolchain}}
- name: Toolchain ${{matrix.toolchain}}
run: cargo +${{matrix.toolchain}} check --workspace --all-targets --all-features
41 changes: 23 additions & 18 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: Codecov

on:
push:
branches: [ master ]
branches:
- master
tags:
- 'v[0-9]+\.*'
pull_request:
branches: [ master ]
branches:
- master
- develop
- 'v[0-9]+.[0-9]+'

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,22 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Build
run: nix develop .#codecov -c cargo build --release
- name: Test
run: nix develop .#codecov -c cargo test --all-features --no-fail-fast --tests
- name: Install grcov
run: nix develop .#codecov -c cargo install grcov
- name: Generate coverage
run: nix develop .#codecov -c grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
- name: Upload coverage to Codecov
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: Collect coverage data (including doctests)
run: |
cargo +nightly llvm-cov --no-report nextest --workspace --all-features
cargo +nightly llvm-cov --no-report --doc --workspace --all-features
cargo +nightly llvm-cov report --doctests --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.lcov
flags: rust
# TODO: set true when CODECOV_TOKEN is set
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
38 changes: 22 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Lints

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches:
- master
- develop
- 'v[0-9]+.[0-9]+'

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,26 +15,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Formatting
run: nix develop .#nightly -c cargo fmt --all -- --check
run: cargo +nightly fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Clippy
run: nix develop .#stable -c cargo clippy --workspace --all-features --all-targets -- -D warnings
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Formatting
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-docs
- name: Formatting
run: cargo +nightly doc --workspace --all-features
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Doc
run: nix develop .#nightly -c cargo doc --workspace --all-features
- uses: crate-ci/typos@master
26 changes: 26 additions & 0 deletions .github/workflows/run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Generate interfaces

on:
push:
branches:
- master
tags:
- 'v[0-9]+\.*'
pull_request:
branches:
- master
- develop
- 'v[0-9]+.[0-9]+'

env:
CARGO_TERM_COLOR: always

jobs:
gen-ifaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo run --features fs
# Due to timestamp there is a difference in supplements.
# - run: git diff | grep -q . && exit 1
31 changes: 25 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,38 @@ name: Tests

on:
push:
branches: [ master ]
branches:
- master
tags:
- 'v[0-9]+\.*'
pull_request:
branches: [ master ]
branches:
- master
- develop
- 'v[0-9]+.[0-9]+'

env:
CARGO_TERM_COLOR: always

jobs:
testing:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Test ${{matrix.os}}
run: cargo test --workspace --all-features --no-fail-fast
wasm-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
- name: Build & test
run: nix develop .#stable -c cargo test --workspace --all-features --no-fail-fast --tests
- uses: dtolnay/rust-toolchain@nightly
- uses: jetli/[email protected]
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Test in headless Chrome
run: wasm-pack test --headless --chrome
7 changes: 3 additions & 4 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ version = "Two"
max_width = 100
array_width = 100
attr_fn_like_width = 100
comment_width = 100
fn_call_width = 100
single_line_if_else_max_width = 100

format_code_in_doc_comments = true
fn_single_line = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_macro_bodies = true
format_strings = true
Expand All @@ -19,9 +21,6 @@ use_try_shorthand = true
wrap_comments = true
where_single_line = true
unstable_features = true
empty_item_single_line = true

binop_separator = "Back"

imports_granularity = "Module"
group_imports = "StdExternalCrate"
Loading
Loading