Switch from Travis to GitHub Actions (#8)

Speeds up builds from 37 min to 15 min
This commit is contained in:
Johan Andersson 2019-10-31 19:53:54 +01:00 committed by GitHub
parent c2b15c989e
commit 9ee5e45bf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 30 deletions

43
.github/workflows/ci.yaml vendored Normal file
View file

@ -0,0 +1,43 @@
on: [push, pull_request]
name: CI
jobs:
lint:
name: Lint
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_11.1.app
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# make sure all code has been formatted with rustfmt
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --color always
# run clippy to verify we have no warnings
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
test:
name: Test
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_11.1.app
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test

View file

@ -1,30 +0,0 @@
language: rust
rust:
- stable
matrix:
fast_finish: true
include:
- os: osx
osx_image: xcode10.2
before_script:
- rustup component add rustfmt clippy
env:
global:
- RUST_BACKTRACE=1
script:
# Ensure everything has been rustfmt'ed
- cargo fmt -- --check
# Download in a separate step to separate
# building from fetching dependencies
- cargo fetch
# Build everything in a separate step to make a
# clear distinction between building and testing
- cargo test --no-run -vv
- cargo test --no-fail-fast -vv
# Because rust isn't brutal enough itself
# We need to run it after the build, otherwise clippy will try to build MoltenVK and travis will time out
- cargo clippy -- -D warnings