Skip to content

Commit

Permalink
Upgrade to better Github Actions for faster and better maintained CI (#…
Browse files Browse the repository at this point in the history
…390)

* Use taiki-e/install-action for installing cargo-deny

* Update CI to use dtolnay/rust-toolchain action

* Enable CI for 0.3.x branch

* Fix documentation CI

* Dummy Cargo.toml change
  • Loading branch information
nicoburns committed Mar 10, 2023
1 parent 2274046 commit 87acbeb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 125 deletions.
129 changes: 29 additions & 100 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- 0.2.x
- 0.3.x

name: Continuous integration

Expand All @@ -13,163 +14,91 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features
- run: cargo test --no-default-features

test-features-default:
name: "Test Suite [Features: Default]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
- uses: actions-rs/cargo@v1
with:
command: test
- uses: dtolnay/rust-toolchain@stable
- run: cargo build
- run: cargo test

test-features-default-with-serde:
name: "Test Suite [Features: Default + serde]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --features serde
- uses: actions-rs/cargo@v1
with:
command: test
args: --features serde
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --features serde
- run: cargo test --features serde

test-features-alloc:
name: "Test Suite [Features: alloc]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features alloc,grid
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features alloc,grid
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features alloc,grid
- run: cargo test --no-default-features --features alloc,grid

test-features-alloc-no-grid:
name: "Test Suite [Features: alloc (no grid)]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features alloc
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features alloc
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features alloc
- run: cargo test --no-default-features --features alloc

test-features-default-no-grid:
name: "Test Suite [Features: std (no grid)]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features std
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features std
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features std
- run: cargo test --no-default-features --features std

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
components: rustfmt
- run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace -- -D warnings
components: clippy
- run: cargo +nightly clippy --workspace -- -D warnings

doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: doc
components: clippy
- run: cargo doc
env:
RUSTDOCFLAGS: "-D warnings"


markdownlint:
name: Markdown Lint
runs-on: ubuntu-latest
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Check for security advisories and unmaintained crates
run: cargo deny check advisories

check-bans:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Check for banned and duplicated dependencies
run: cargo deny check bans

check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Check for unauthorized licenses
run: cargo deny check licenses

check-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Checked for unauthorized crate sources
run: cargo deny check sources
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [
]
edition = "2021"
include = ["src/**/*", "Cargo.toml", "README.md"]
description = "A flexible UI layout library"
description = "A flexible UI layout library "
repository = "https://github.com/DioxusLabs/taffy"
keywords = ["cross-platform", "layout", "flexbox", "css-grid", "grid"]
categories = ["gui"]
Expand Down

0 comments on commit 87acbeb

Please sign in to comment.