Skip to content

Commit 19902d4

Browse files
authored
ci: Small cleanup of the Github Actions in the PR workflow (#465)
* Update GHA actions to their latest versions Keep only the release related actions as is. The action is deprecated and should be replaces by a new one. Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * Test on Linux ARM64 too Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * Fix clippy errors for Rust 1.84.1 Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * Use dependabot to send PRs for new versions of the used Github Actions Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> --------- Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
1 parent da6278f commit 19902d4

File tree

18 files changed

+269
-269
lines changed

18 files changed

+269
-269
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+

.github/workflows/release-please.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: github.repository_owner == 'rust-bio'
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
with:
1515
submodules: recursive
1616

@@ -22,26 +22,22 @@ jobs:
2222
bump-minor-pre-major: true
2323

2424
- name: Install stable toolchain
25-
uses: actions-rs/toolchain@v1
25+
uses: dtolnay/rust-toolchain@stable
2626
if: ${{ steps.release_main.outputs.release_created }}
2727
with:
2828
toolchain: stable
29-
override: true
3029

3130
- name: Install system dependencies
3231
if: ${{ steps.release_main.outputs.release_created }}
3332
run: |
3433
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
3534
36-
- uses: Swatinem/rust-cache@v1.3.0
35+
- uses: Swatinem/rust-cache@v2
3736
if: ${{ steps.release_main.outputs.release_created }}
3837

3938
- name: Publish rust-htslib
4039
if: ${{ steps.release_main.outputs.release_created }}
41-
uses: actions-rs/cargo@v1
42-
with:
43-
command: publish
44-
args: --token ${{ secrets.CRATES_IO_TOKEN }}
40+
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
4541

4642
# - uses: katyo/publish-crates@v1
4743
# if: ${{ steps.release_main.outputs.release_created || steps.release_sys.outputs.release_created }}

.github/workflows/rust.yml

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,116 +8,113 @@ on:
88

99
jobs:
1010
Formatting:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
- name: Install stable toolchain
17-
uses: actions-rs/toolchain@v1.0.6
17+
uses: dtolnay/rust-toolchain@stable
1818
with:
1919
toolchain: stable
20-
override: true
2120
components: rustfmt
2221

2322
- name: Check format
2423
run: cargo fmt -- --check
2524

2625
Linting:
27-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-22.04
2827
steps:
2928
- name: Checkout repository
30-
uses: actions/checkout@v2
29+
uses: actions/checkout@v4
3130
with:
3231
submodules: recursive
3332

3433
- name: Install stable toolchain
35-
uses: actions-rs/toolchain@v1.0.6
34+
uses: dtolnay/rust-toolchain@stable
3635
with:
3736
toolchain: stable
38-
override: true
3937
components: clippy
4038

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

4642
Testing:
4743
needs: Formatting
48-
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
os: [ubuntu-22.04, ubuntu-22.04-arm]
47+
runs-on: ${{ matrix.os }}
4948
steps:
5049
- name: Checkout repository
51-
uses: actions/checkout@v2
50+
uses: actions/checkout@v4
5251
with:
5352
submodules: recursive
5453

5554
- name: Install nightly toolchain
56-
uses: actions-rs/toolchain@v1.0.6
55+
uses: dtolnay/rust-toolchain@stable
5756
with:
5857
toolchain: nightly
59-
override: true
6058

6159
- name: Install system dependencies
6260
run: |
6361
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
6462
65-
- uses: Swatinem/rust-cache@v1.3.0
63+
- uses: Swatinem/rust-cache@v2
6664

6765
- name: Run cargo-tarpaulin
68-
uses: actions-rs/[email protected]
69-
with:
70-
# TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23
71-
version: "0.22.0"
72-
args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1"
66+
run: |
67+
set -x
68+
cargo install cargo-tarpaulin
69+
cargo tarpaulin --all-features --tests --doc --out Lcov -- --test-threads 1
7370
7471
- name: Upload coverage
75-
uses: coverallsapp/github-action@v1
72+
uses: coverallsapp/github-action@v2
7673
with:
7774
github-token: ${{ secrets.GITHUB_TOKEN }}
7875
path-to-lcov: ./lcov.info
7976

8077
Testing-Features:
8178
needs: Formatting
82-
runs-on: ubuntu-latest
8379
strategy:
8480
matrix:
81+
os: [ubuntu-22.04, ubuntu-22.04-arm]
8582
target:
8683
- no-default-features
8784
- all-features
8885
include:
8986
- target: no-default-features
9087
args: --no-default-features
91-
use_cross: false
9288
- target: all-features
89+
os: ubuntu-22.04
9390
args: --all-features
9491
toolchain_target: x86_64-unknown-linux-musl
95-
use_cross: false
92+
- target: all-features
93+
os: ubuntu-22.04-arm
94+
args: --all-features
95+
toolchain_target: aarch64-unknown-linux-musl
96+
runs-on: ${{ matrix.os }}
9697

9798
steps:
9899
- name: Checkout repository
99-
uses: actions/checkout@v2
100+
uses: actions/checkout@v4
100101
with:
101102
submodules: recursive
102103

103104
- name: Install stable toolchain
104-
uses: actions-rs/toolchain@v1.0.6
105+
uses: dtolnay/rust-toolchain@stable
105106
with:
106107
toolchain: stable
107-
override: true
108108

109109
- name: Install system dependencies
110110
run: |
111111
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
112112
113-
- uses: Swatinem/rust-cache@v1.3.0
113+
- uses: Swatinem/rust-cache@v2
114114

115115
- name: Test
116-
uses: actions-rs/cargo@v1
117-
with:
118-
command: test
119-
args: ${{ matrix.args }}
120-
use-cross: ${{ matrix.use_cross }}
116+
run: |
117+
cargo test ${{ matrix.args }}
121118
122119
Testing-MacOS:
123120
needs: Formatting
@@ -150,27 +147,23 @@ jobs:
150147

151148
steps:
152149
- name: Checkout repository
153-
uses: actions/checkout@v2
150+
uses: actions/checkout@v4
154151
with:
155152
submodules: recursive
156153

157154
- name: Install stable toolchain
158-
uses: actions-rs/toolchain@v1.0.6
155+
uses: dtolnay/rust-toolchain@stable
159156
with:
160157
toolchain: ${{ matrix.toolchain }}
161-
target: ${{ matrix.toolchain_target }}
158+
targets: ${{ matrix.toolchain_target }}
162159
override: true
163-
default: ${{ matrix.default }}
164160

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

168164
- name: Test
169-
uses: actions-rs/[email protected]
170-
with:
171-
use-cross: false # cross is not supported on GHA OSX runner, see: https://github.community/t/why-is-docker-not-installed-on-macos/17017
172-
command: test
173-
args: --release --all-features --verbose ${{ matrix.aux_args }}
165+
run: |
166+
cargo test --release --all-features --verbose ${{ matrix.aux_args }}
174167
# Testing-OSX-MUSL-BigSur:
175168
# needs: Formatting
176169
# runs-on: macOS-11.0

src/bam/buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mod tests {
182182

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

188188
buffer.fetch(b"CHROMOSOME_I", 1, 5).unwrap();

src/bam/ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//// Copyright 2019 Johannes Köster and Florian Finkernagel.
1+
// Copyright 2019 Johannes Köster and Florian Finkernagel.
22
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
33
// This file may not be copied, modified, or distributed
44
// except according to those terms.

src/bam/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ mod tests {
165165
fn test_push_tag() {
166166
let mut record = HeaderRecord::new(b"HD");
167167
record.push_tag(b"X1", 0);
168-
record.push_tag(b"X2", &0);
168+
record.push_tag(b"X2", 0);
169169

170170
let x = "x".to_string();
171171
record.push_tag(b"X3", x.as_str());

0 commit comments

Comments
 (0)