Skip to content

Commit

Permalink
Migrate CI to GitHub Actions
Browse files Browse the repository at this point in the history
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
Ortham committed Oct 12, 2020
1 parent 1bc4c4d commit d2e78a2
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 68 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/ci.yml
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
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ license = "GPL-3.0"
edition = "2018"

[badges]
travis-ci = { repository = "Ortham/esplugin" }
coveralls = { repository = "Ortham/esplugin" }

[dependencies]
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
esplugin
=======

[![Build status](https://ci.appveyor.com/api/projects/status/ukb7ns50fskawwsh/branch/master?svg=true)](https://ci.appveyor.com/project/Ortham/esplugin/branch/master)
[![Travis Build Status](https://travis-ci.org/Ortham/esplugin.svg?branch=master)](https://travis-ci.org/Ortham/esplugin)
![CI](https://github.com/Ortham/esplugin/workflows/CI/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/Ortham/esplugin/badge.svg?branch=master)](https://coveralls.io/github/Ortham/esplugin?branch=master)
[![dependency status](https://deps.rs/repo/github/Ortham/esplugin/status.svg)](https://deps.rs/repo/github/Ortham/esplugin)
[![docs](https://docs.rs/esplugin/badge.svg)](https://docs.rs/crate/esplugin)

A free software library for reading Elder Scrolls Plugin (`.esp`), Elder Scrolls Master (`.esm`) and Elder Scrolls Light Master (`.esl`) files. It can currently parse plugins for the following games:
Expand Down
36 changes: 0 additions & 36 deletions appveyor.yml

This file was deleted.

0 comments on commit d2e78a2

Please sign in to comment.