Skip to content

Commit 86b33c0

Browse files
bors[bot]eldruin
andauthored
Merge #29
29: Use GHA instead of Travis for CI r=ryankurte a=eldruin Closes #28 Co-authored-by: Diego Barrios Romero <[email protected]>
2 parents b4ef60b + 2ecfd18 commit 86b33c0

File tree

7 files changed

+115
-21
lines changed

7 files changed

+115
-21
lines changed

.github/bors.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
block_labels = ["needs-decision"]
2+
delete_merged_branches = true
3+
required_approvals = 1
4+
status = [
5+
"ci-linux (stable, x86_64-unknown-linux-gnu)",
6+
"ci-linux (stable, x86_64-unknown-linux-musl)",
7+
"ci-linux (beta, x86_64-unknown-linux-gnu)",
8+
"ci-linux (beta, x86_64-unknown-linux-musl)",
9+
"ci-linux (1.31.0, x86_64-unknown-linux-gnu)",
10+
"ci-linux (1.31.0, x86_64-unknown-linux-musl)",
11+
]

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci-linux:
10+
runs-on: ubuntu-latest
11+
continue-on-error: ${{ matrix.experimental || false }}
12+
strategy:
13+
matrix:
14+
# All published crates must build on stable.
15+
rust: [stable, beta, 1.31.0]
16+
17+
# The default target we're compiling on and for.
18+
TARGET: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]
19+
20+
include:
21+
# Test nightly but don't fail the build.
22+
- rust: nightly
23+
experimental: true
24+
TARGET: x86_64-unknown-linux-gnu
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: ${{ matrix.rust }}
32+
target: ${{ matrix.TARGET }}
33+
override: true
34+
- uses: actions-rs/cargo@v1
35+
with:
36+
command: check
37+
args: --target=${{ matrix.TARGET }}
38+
- uses: actions-rs/cargo@v1
39+
with:
40+
command: build
41+
args: --target=${{ matrix.TARGET }}
42+
- uses: actions-rs/cargo@v1
43+
with:
44+
command: test
45+
args: --target=${{ matrix.TARGET }}
46+
- uses: actions-rs/cargo@v1
47+
with:
48+
command: build
49+
args: --target=${{ matrix.TARGET }} --examples

.github/workflows/clippy.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Clippy check
7+
jobs:
8+
clippy_check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions-rs/toolchain@v1
13+
with:
14+
profile: minimal
15+
toolchain: stable
16+
override: true
17+
components: clippy
18+
- uses: actions-rs/clippy-check@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rustfmt.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Code formatting check
7+
8+
jobs:
9+
fmt:
10+
name: Rustfmt
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions-rs/toolchain@v1
15+
with:
16+
profile: minimal
17+
toolchain: stable
18+
override: true
19+
components: rustfmt
20+
- uses: actions-rs/cargo@v1
21+
with:
22+
command: fmt
23+
args: --all -- --check

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/spidev-bidir.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
extern crate spidev;
2-
use spidev::{Spidev, SpidevOptions, SpiModeFlags};
32
use spidev::spidevioctl::SpidevTransfer;
3+
use spidev::{SpiModeFlags, Spidev, SpidevOptions};
44

55
fn main() {
66
let mut spidev = Spidev::open("/dev/spidev0.0").unwrap();
77
let options = SpidevOptions::new()
8-
.bits_per_word(8)
9-
.max_speed_hz(5000)
10-
.lsb_first(false)
11-
.mode(SpiModeFlags::SPI_MODE_0)
12-
.build();
8+
.bits_per_word(8)
9+
.max_speed_hz(5000)
10+
.lsb_first(false)
11+
.mode(SpiModeFlags::SPI_MODE_0)
12+
.build();
1313
spidev.configure(&options).unwrap();
1414

1515
println!("===== Single transfer =========");
@@ -24,9 +24,11 @@ fn main() {
2424
let tx_buf3 = [0xff, 0xfe, 0xfd];
2525
let mut rx_buf3 = [0; 3];
2626
let result = {
27-
let mut transfers = vec![SpidevTransfer::read(&mut rx_buf1),
28-
SpidevTransfer::write(&tx_buf2),
29-
SpidevTransfer::read_write(&tx_buf3, &mut rx_buf3)];
27+
let mut transfers = vec![
28+
SpidevTransfer::read(&mut rx_buf1),
29+
SpidevTransfer::write(&tx_buf2),
30+
SpidevTransfer::read_write(&tx_buf3, &mut rx_buf3),
31+
];
3032
spidev.transfer_multiple(&mut transfers)
3133
};
3234
match result {

examples/spidev-hello.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extern crate spidev;
2-
use std::io::prelude::*;
32
use spidev::Spidev;
3+
use std::io::prelude::*;
44

55
fn main() {
66
let mut spidev = Spidev::open("/dev/spidev0.0").unwrap();

0 commit comments

Comments
 (0)