Skip to content
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
43 changes: 11 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,38 @@ jobs:
features: [--no-default-features, --all-features]
steps:
- name: Checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v5

- name: Install ${{ matrix.toolchain }} toolchain
run: |
rustup update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: ${{ matrix.features }} --workspace
run: cargo check ${{ matrix.features }} --workspace

no-std:
name: no_std Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v5

- name: Install nightly toolchain
run: |
rustup update nightly
rustup default nightly

- name: Install cargo no-std-check
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-no-std-check
run: cargo install cargo-no-std-check

# https://github.com/mystor/cargo-no-std-check/issues/2
# `--no-default-features` doesn't work with `--workspace` correctly.
- name: Run cargo no-std-check on libflate crate
uses: actions-rs/cargo@v1
with:
command: no-std-check
args: --no-default-features
run: cargo no-std-check --no-default-features

- name: Run cargo no-std-check on libflate_lz77 crate
uses: actions-rs/cargo@v1
with:
command: no-std-check
args: --no-default-features --manifest-path libflate_lz77/Cargo.toml
run: cargo no-std-check --no-default-features --manifest-path libflate_lz77/Cargo.toml

test:
name: Test Suite
Expand All @@ -66,18 +54,15 @@ jobs:
features: [--no-default-features, --all-features]
steps:
- name: Checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v5

- name: Install ${{ matrix.toolchain }} toolchain
run: |
rustup update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }} --workspace
run: cargo test ${{ matrix.features }} --workspace

lints:
name: Lints
Expand All @@ -88,7 +73,7 @@ jobs:
features: [--no-default-features, --all-features]
steps:
- name: Checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v5

- name: Install ${{ matrix.toolchain }} toolchain
run: |
Expand All @@ -97,14 +82,8 @@ jobs:
rustup component add rustfmt clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Run cargo clippy
if: matrix.toolchain != 'beta'
uses: actions-rs/cargo@v1
with:
command: clippy
args: ${{ matrix.features }} --workspace -- -D warnings
run: cargo clippy ${{ matrix.features }} --workspace -- -D warnings
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create GitHub Release and Publish to crates.io

on:
push:
tags: ['v*']

jobs:
github-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- id: create-release
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: github-release
runs-on: ubuntu-latest
# environment: release # Optional: for enhanced security
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ categories = ["compression", "no-std"]
license = "MIT"
edition = "2021"
include = [
'Cargo.toml',
'README.md',
'LICENSE',
'src/**/*.rs',
"Cargo.toml",
"README.md",
"LICENSE",
"src/**/*.rs",
]

[dependencies]
Expand Down