ci: replace travis with github actions
This commit is contained in:
parent
07113c6e1c
commit
ef1a2d1d5c
2 changed files with 36 additions and 18 deletions
36
saphyr/.github/workflows/ci.yml
vendored
Normal file
36
saphyr/.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Lints and checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy --no-self-update
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Run clippy checks
|
||||
run: cargo clippy --all-targets -- -D warnings
|
||||
- name: Run format checks
|
||||
run: cargo fmt --check
|
||||
|
||||
test:
|
||||
name: Test using Rust ${{ matrix.rust }} on ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
rust: [stable]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- run: git submodule update --init
|
||||
- run: rustup toolchain install ${{ matrix.rust }} --profile minimal --no-self-update
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Run build
|
||||
run: cargo build
|
||||
- name: Run tests
|
||||
run: cargo test -v
|
|
@ -1,18 +0,0 @@
|
|||
language: rust
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- rust: stable
|
||||
- rust: beta
|
||||
- rust: nightly
|
||||
- rust: 1.33.0
|
||||
- rust: nightly
|
||||
env: CLIPPY
|
||||
script: |
|
||||
if rustup component add clippy-preview; then
|
||||
cargo clippy -- -Dclippy
|
||||
fi
|
||||
|
||||
script:
|
||||
- cargo build
|
||||
- cargo test
|
Loading…
Reference in a new issue