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: Small cleanup of the Github Actions in the PR workflow #465

Merged
merged 4 commits into from
Feb 19, 2025
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

12 changes: 4 additions & 8 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: github.repository_owner == 'rust-bio'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -22,26 +22,22 @@ jobs:
bump-minor-pre-major: true

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
if: ${{ steps.release_main.outputs.release_created }}
with:
toolchain: stable
override: true

- name: Install system dependencies
if: ${{ steps.release_main.outputs.release_created }}
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev

- uses: Swatinem/rust-cache@v1.3.0
- uses: Swatinem/rust-cache@v2
if: ${{ steps.release_main.outputs.release_created }}

- name: Publish rust-htslib
if: ${{ steps.release_main.outputs.release_created }}
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_IO_TOKEN }}
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}

# - uses: katyo/publish-crates@v1
# if: ${{ steps.release_main.outputs.release_created || steps.release_sys.outputs.release_created }}
Expand Down
79 changes: 36 additions & 43 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,116 +8,113 @@ on:

jobs:
Formatting:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1.0.6
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: rustfmt

- name: Check format
run: cargo fmt -- --check

Linting:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install stable toolchain
uses: actions-rs/toolchain@v1.0.6
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: clippy

- name: Lint with clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
run: RUSTFLAGS="-Dwarnings" cargo clippy --all-features --all-targets -- -Dclippy::all -Dunused_imports

Testing:
needs: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1.0.6
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true

- name: Install system dependencies
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev

- uses: Swatinem/rust-cache@v1.3.0
- uses: Swatinem/rust-cache@v2

- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
# TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23
version: "0.22.0"
args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1"
run: |
set -x
cargo install cargo-tarpaulin
cargo tarpaulin --all-features --tests --doc --out Lcov -- --test-threads 1

- name: Upload coverage
uses: coverallsapp/github-action@v1
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info

Testing-Features:
needs: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm]
target:
- no-default-features
- all-features
include:
- target: no-default-features
args: --no-default-features
use_cross: false
- target: all-features
os: ubuntu-22.04
args: --all-features
toolchain_target: x86_64-unknown-linux-musl
use_cross: false
- target: all-features
os: ubuntu-22.04-arm
args: --all-features
toolchain_target: aarch64-unknown-linux-musl
runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install stable toolchain
uses: actions-rs/toolchain@v1.0.6
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true

- name: Install system dependencies
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev

- uses: Swatinem/rust-cache@v1.3.0
- uses: Swatinem/rust-cache@v2

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.args }}
use-cross: ${{ matrix.use_cross }}
run: |
cargo test ${{ matrix.args }}

Testing-MacOS:
needs: Formatting
Expand Down Expand Up @@ -150,27 +147,23 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install stable toolchain
uses: actions-rs/toolchain@v1.0.6
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.toolchain_target }}
targets: ${{ matrix.toolchain_target }}
override: true
default: ${{ matrix.default }}

- name: Install htslib dependencies
run: brew install bzip2 zlib xz curl-openssl

- name: Test
uses: actions-rs/[email protected]
with:
use-cross: false # cross is not supported on GHA OSX runner, see: https://github.jparrowsec.cnmunity/t/why-is-docker-not-installed-on-macos/17017
command: test
args: --release --all-features --verbose ${{ matrix.aux_args }}
run: |
cargo test --release --all-features --verbose ${{ matrix.aux_args }}
# Testing-OSX-MUSL-BigSur:
# needs: Formatting
# runs-on: macOS-11.0
Expand Down
2 changes: 1 addition & 1 deletion src/bam/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ mod tests {

#[test]
fn test_buffer() {
let reader = bam::IndexedReader::from_path(&"test/test.bam").unwrap();
let reader = bam::IndexedReader::from_path("test/test.bam").unwrap();
let mut buffer = RecordBuffer::new(reader, false);

buffer.fetch(b"CHROMOSOME_I", 1, 5).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/bam/ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//// Copyright 2019 Johannes Köster and Florian Finkernagel.
// Copyright 2019 Johannes Köster and Florian Finkernagel.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
Expand Down
2 changes: 1 addition & 1 deletion src/bam/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ mod tests {
fn test_push_tag() {
let mut record = HeaderRecord::new(b"HD");
record.push_tag(b"X1", 0);
record.push_tag(b"X2", &0);
record.push_tag(b"X2", 0);

let x = "x".to_string();
record.push_tag(b"X3", x.as_str());
Expand Down
Loading
Loading