fix code warnings and clean up the code base #425
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-unknown-linux-musl, aarch64-unknown-linux-musl] | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache cargo home | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-home | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: ${{ runner.os }}-${{ matrix.target }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.target }}-build-${{ env.cache-name }}- | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
target: ${{ matrix.target }} | |
- name: Install Dependencies | |
run: sudo apt -y install at-spi2-core systemd dunst xvfb | |
- name: setup dbus and notification daemon | |
run: | |
sudo systemctl start dbus; | |
systemctl --user start dbus; | |
xvfb-run dunst --screen 0 600x400x8 & | |
- name: Run tests | |
run: cargo test | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache cargo home | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-home | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-x86_64-unknown-linux-gnu-build-${{ env.cache-name }}- | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: clippy | |
- name: Run tests | |
run: cargo clippy --tests --workspace --no-deps -- -D warnings | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt | |
- name: Run formatter | |
run: cargo fmt --all --check | |
rustdoc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache cargo home | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-home | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-x86_64-unknown-linux-gnu-build-${{ env.cache-name }}- | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
- name: Generate Documentation | |
run: cargo doc --workspace --document-private-items | |
- name: Deploy Documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.PAGES_DEPLOY_KEY }} | |
external_repository: odilia-app/odilia-app.github.io | |
publish_dir: ./target/doc | |
destination_dir: doc/devel | |
keep_files: true | |
user_name: github-actions | |
user_email: [email protected] | |
publish_branch: main | |
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache cargo home | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-home | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: ${{ runner.os }}-${{ matrix.target }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.target }}-build-${{ env.cache-name }}- | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: llvm-tools | |
- name: cargo install llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: cargo generate lockfile | |
if: hashFiles('Cargo.lock') == '' | |
run: cargo generate-lockfile | |
- name: Install Dependencies | |
run: sudo apt -y install at-spi2-core systemd dunst xvfb | |
- name: setup dbus and notification daemon | |
run: | |
sudo systemctl start dbus; | |
systemctl --user start dbus; | |
xvfb-run dunst --screen 0 600x400x8 & | |
- name: cargo llvm-cov | |
run: cargo llvm-cov --lcov --output-path lcov.info | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_fail: true | |
msrv-compliance: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache cargo home | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-home | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-x86_64-unknown-linux-gnu-build-${{ env.cache-name }}- | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
- name: Install Cargo MSRV Verifier | |
run: cargo install cargo-msrv --force | |
- name: Check MSRV Compliance | |
# check msrv compliance *inside* the binary odilia directory instead of the worksapce | |
run: cd odilia && cargo msrv verify |