Skip to content

Commit 36954a6

Browse files
committed
Use GHA instead of Travis for CI
1 parent f24a9fa commit 36954a6

File tree

7 files changed

+135
-19
lines changed

7 files changed

+135
-19
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @rust-embedded/embedded-linux

.github/bors.toml

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

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci-linux:
10+
name: CI
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
# All generated code should be running on stable now
16+
rust: [stable]
17+
18+
# The default target we're compiling on and for
19+
TARGET: [x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf]
20+
21+
include:
22+
# Test MSRV
23+
- rust: 1.46.0
24+
TARGET: x86_64-unknown-linux-gnu
25+
26+
# Test nightly but don't fail
27+
- rust: nightly
28+
experimental: true
29+
TARGET: x86_64-unknown-linux-gnu
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
34+
- uses: actions-rs/toolchain@v1
35+
with:
36+
profile: minimal
37+
toolchain: ${{ matrix.rust }}
38+
target: ${{ matrix.TARGET }}
39+
override: true
40+
41+
- name: Install armv7 libraries
42+
if: ${{ matrix.TARGET == 'armv7-unknown-linux-gnueabihf' }}
43+
run: sudo apt-get install -y libc6-armhf-cross libc6-dev-armhf-cross gcc-arm-linux-gnueabihf
44+
45+
- uses: actions-rs/cargo@v1
46+
if: ${{ matrix.TARGET != 'armv7-unknown-linux-gnueabihf' }}
47+
with:
48+
command: test
49+
args: --target=${{ matrix.TARGET }}
50+
51+
52+
- uses: actions-rs/cargo@v1
53+
if: ${{ matrix.TARGET == 'armv7-unknown-linux-gnueabihf' }}
54+
with:
55+
command: build
56+
args: --target=${{ matrix.TARGET }}
57+
58+
ci-macos:
59+
name: CI-macOS
60+
runs-on: macos-11
61+
62+
strategy:
63+
matrix:
64+
rust: [stable, 1.46.0]
65+
TARGET: [x86_64-apple-darwin]
66+
67+
steps:
68+
- uses: actions/checkout@v2
69+
70+
- uses: actions-rs/toolchain@v1
71+
with:
72+
profile: minimal
73+
toolchain: ${{ matrix.rust }}
74+
target: ${{ matrix.TARGET }}
75+
override: true
76+
77+
- uses: actions-rs/cargo@v1
78+
with:
79+
command: build
80+
args: --target=${{ matrix.TARGET }}

.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: 1.55.0
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 & 18 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rust I2cdev
22

3-
[![Build Status](https://travis-ci.org/rust-embedded/rust-i2cdev.svg?branch=master)](https://travis-ci.org/rust-embedded/rust-i2cdev)
3+
[![Build Status](https://github.com/rust-embedded/rust-i2cdev/workflows/CI/badge.svg)](https://github.com/rust-embedded/rust-i2cdev/actions)
44
[![Version](https://img.shields.io/crates/v/i2cdev.svg)](https://crates.io/crates/i2cdev)
55
[![License](https://img.shields.io/crates/l/i2cdev.svg)](https://github.com/rust-embedded/rust-i2cdev/blob/master/README.md#license)
66

0 commit comments

Comments
 (0)