Skip to content

Improve CI #74

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

Merged
merged 2 commits into from
Jul 14, 2023
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
27 changes: 12 additions & 15 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
- main

env:
CARGO_INCREMENTAL: 1
CACHE_VERSION: 0

CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_TERM_COLOR: always

GITHUB_CACHE_VERSION: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

RUST_BACKTRACE: full
Expand All @@ -24,29 +25,25 @@ jobs:
matrix:
action: [clippy, fmt, test]
steps:
- name: Setup build environment
run: rustup toolchain install nightly --profile minimal
- name: Fetch latest code
uses: actions/checkout@v3
- name: Cache cargo
uses: actions/cache@v3
- uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-
- name: Cargo ${{ matrix.action }}
prefix-key: ${{ env.CACHE_VERSION }}
- name: Cargo clippy
if: matrix.action == 'clippy'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --all-targets --locked
- name: Cargo ${{ matrix.action }}
- name: Cargo fmt
if: matrix.action == 'fmt'
run: cargo ${{ matrix.action }} --all -- --check
- name: Cargo ${{ matrix.action }}
run: cargo fmt --all -- --check
- name: Cargo test
if: matrix.action == 'test'
run: cargo ${{ matrix.action }} run --release --workspace --all-features --all-targets --locked
run: cargo test --profile ci-dev --workspace --all-features --all-targets --locked
- name: Fast fail
uses: vishnudxb/cancel-workflow@v1.2
if: failure()
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ readme = "README.md"
repository = "https://github.com/hack-ink/array-bytes"
version = "6.1.0"

[profile.ci-dev]
incremental = false
inherits = "dev"

[dependencies]
serde = { version = "1.0", optional = true, default-features = false }

Expand Down