From 9ee5e45bf6e97c29ad9d1bb44a5dbe5bd7394295 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Thu, 31 Oct 2019 19:53:54 +0100 Subject: [PATCH] Switch from Travis to GitHub Actions (#8) Speeds up builds from 37 min to 15 min --- .github/workflows/ci.yaml | 43 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 30 --------------------------- 2 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..faf9594 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index abe0621..0000000 --- a/.travis.yml +++ /dev/null @@ -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