Skip to content

Commit

Permalink
Use GHA instead of Travis for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eldruin committed Sep 16, 2021
1 parent f24a9fa commit 36954a6
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rust-embedded/embedded-linux
10 changes: 10 additions & 0 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = [
"CI (stable, x86_64-unknown-linux-gnu)",
"CI (stable, armv7-unknown-linux-gnueabihf)",
"CI (1.46.0, x86_64-unknown-linux-gnu)",
"CI (stable, x86_64-apple-darwin)",
"CI (1.46.0, x86_64-apple-darwin)",
]
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Continuous integration

jobs:
ci-linux:
name: CI
runs-on: ubuntu-latest

strategy:
matrix:
# All generated code should be running on stable now
rust: [stable]

# The default target we're compiling on and for
TARGET: [x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf]

include:
# Test MSRV
- rust: 1.46.0
TARGET: x86_64-unknown-linux-gnu

# Test nightly but don't fail
- rust: nightly
experimental: true
TARGET: x86_64-unknown-linux-gnu

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true

- name: Install armv7 libraries
if: ${{ matrix.TARGET == 'armv7-unknown-linux-gnueabihf' }}
run: sudo apt-get install -y libc6-armhf-cross libc6-dev-armhf-cross gcc-arm-linux-gnueabihf

- uses: actions-rs/cargo@v1
if: ${{ matrix.TARGET != 'armv7-unknown-linux-gnueabihf' }}
with:
command: test
args: --target=${{ matrix.TARGET }}


- uses: actions-rs/cargo@v1
if: ${{ matrix.TARGET == 'armv7-unknown-linux-gnueabihf' }}
with:
command: build
args: --target=${{ matrix.TARGET }}

ci-macos:
name: CI-macOS
runs-on: macos-11

strategy:
matrix:
rust: [stable, 1.46.0]
TARGET: [x86_64-apple-darwin]

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
override: true

- uses: actions-rs/cargo@v1
with:
command: build
args: --target=${{ matrix.TARGET }}
20 changes: 20 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Clippy check
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.55.0
override: true
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches: [ staging, trying, master ]
pull_request:

name: Code formatting check

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rust I2cdev

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

Expand Down

0 comments on commit 36954a6

Please sign in to comment.