-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There's nothing wrong with Travis CI, but AppVeyor has started to fail builds with a toolchain error when they install rustfmt. This isn't the first time that AppVeyor has broken my builds, so I'm migrating away from it. I could have migrated to Travis CI's relatively new Windows support, but that's still in the early adoption phase according to its own docs, and I might as well instead move to GitHub's first-party offering. There's no point then using Travis CI for Linux builds when that can be done on GitHub Actions too.
- Loading branch information
Showing
5 changed files
with
100 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Rustfmt | ||
run: | | ||
rustup component add rustfmt | ||
rustfmt --version | ||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
|
||
windows: | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Prepare test resources | ||
run: | | ||
(New-Object Net.WebClient).DownloadFile('https://github.com/WrinklyNinja/testing-plugins/archive/1.4.1.zip', "$PWD/1.4.1.zip") | ||
7z x 1.4.1.zip | ||
mv testing-plugins-1.4.1 testing-plugins | ||
- name: Build and run tests | ||
run: cargo test --all --all-features | ||
|
||
# Need to rebuild the FFI wrapper so that its binary is given a filename | ||
# without a hash. | ||
- name: Build FFI wrapper | ||
run: cargo build --manifest-path ffi/Cargo.toml --features ffi-headers | ||
|
||
# Use bash because PowerShell doesn't fail if one command fails. | ||
- name: Build and run C++ tests | ||
shell: bash | ||
run: | | ||
mkdir ffi/build | ||
cd ffi/build | ||
cmake .. | ||
cmake --build . | ||
ctest | ||
linux: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install Tarpaulin | ||
run: curl -sL https://github.com/xd009642/tarpaulin/releases/download/0.14.2/cargo-tarpaulin-0.14.2-travis.tar.gz | tar xvz -C $HOME/.cargo/bin | ||
|
||
- name: Prepare test resources | ||
run: | | ||
wget https://github.com/WrinklyNinja/testing-plugins/archive/1.4.1.tar.gz | ||
tar -xf 1.4.1.tar.gz | ||
mv testing-plugins-1.4.1 testing-plugins | ||
- name: Build and run tests with code coverage | ||
run: cargo tarpaulin --workspace --features compressed-fields --out Lcov | ||
|
||
- name: Upload code coverage to Coveralls | ||
uses: coverallsapp/github-action@v1.1.1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ./lcov.info | ||
|
||
# Need to rebuild the FFI wrapper so that its binary is given a filename | ||
# without a hash. | ||
- name: Build FFI wrapper | ||
run: cargo build --manifest-path ffi/Cargo.toml --features ffi-headers | ||
|
||
# Use bash because PowerShell doesn't fail if one command fails. | ||
- name: Build and run C++ tests | ||
shell: bash | ||
run: | | ||
mkdir ffi/build | ||
cd ffi/build | ||
cmake .. | ||
cmake --build . | ||
ctest |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.