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

ci: Polish github actions #96

Merged
merged 1 commit into from
Sep 3, 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
75 changes: 11 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: CI

on:
pull_request:
branches:
- master
push:
branches:
- master
- staging
- trying

env:
RUSTFLAGS: -Dwarnings
Expand All @@ -21,33 +21,12 @@ jobs:
rust: [nightly, beta, stable]

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4

- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}

- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}

- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
run: rustup install ${{ matrix.rust }}

- name: Install Ceph
- name: Install Ceph
run: |
sudo apt-get update
sudo apt-get install -y apt-transport-https
Expand All @@ -57,29 +36,13 @@ jobs:
sudo apt-get install -y --no-install-recommends uuid-runtime ceph-mgr ceph-mon ceph-osd ceph-mds librados-dev libradosstriper-dev

- name: check
uses: actions-rs/cargo@v1
with:
command: check
args: --all --bins --tests
run: cargo check --all-targets

- name: check rados_striper
uses: actions-rs/cargo@v1
with:
command: check
args: --features rados_striper --all --bins --examples --tests

- name: check bench
uses: actions-rs/cargo@v1
if: matrix.rust == 'nightly'
with:
command: check
args: --benches
run: cargo check --features rados_striper --all-targets

- name: tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all
run: cargo test --all-targets

cross:
name: Cross compile
Expand All @@ -92,13 +55,10 @@ jobs:
- aarch64-unknown-linux-gnu

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4

- name: Install nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
run: rustup install nightly

- name: Install cross
run: cargo install cross
Expand All @@ -110,19 +70,6 @@ jobs:
name: Checking fmt and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- name: setup
run: |
rustup component add rustfmt
rustc --version

- uses: actions/checkout@v4
- name: fmt
run: cargo fmt --all -- --check
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "stable"
components = ["rustfmt", "clippy"]