Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Setup GitHub Actions #128

Merged
merged 4 commits into from
May 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master

jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
toolchain:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
include:
- toolchain: x86_64-unknown-linux-gnu
builder: ubuntu-latest
os: linux
- toolchain: x86_64-apple-darwin
builder: macos-latest
os: macos
- toolchain: x86_64-pc-windows-msvc
builder: windows-latest
os: windows

name: nightly - ${{ matrix.toolchain }}
runs-on: ${{ matrix.builder }}

steps:
- uses: actions/checkout@v2

- name: Run tests
run: sh ci/run.sh ${{ matrix.os }}
40 changes: 40 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Style check

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master

jobs:
style_check:
strategy:
fail-fast: false

name: Shellcheck
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: |
shellcheck --version
shellcheck ci/*.sh

- name: Update nightly
run: |
rustup update nightly

- name: rustfmt
run: |
if rustup component add rustfmt; then
cargo fmt --all -- --check
fi

- name: Clippy
run: |
if rustup component add clippy rustc-dev; then
cargo clippy --all
fi
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

22 changes: 8 additions & 14 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

set -ex

OS=${1}

export RUST_BACKTRACE=full
#export RUST_TEST_NOCAPTURE=1

rustup update nightly

cargo +nightly install rustup-toolchain-install-master
if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
if [ "${OS}" = "windows" ]; then
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools -i x86_64-pc-windows-msvc
else
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools
Expand All @@ -16,12 +20,7 @@ rustup override set master
cargo build
cargo test --verbose -- --nocapture

# avoid weird cygwin issues for now
if [ -n "$APPVEYOR" ]; then
exit 0
fi

case "${TRAVIS_OS_NAME}" in
case "${OS}" in
*"linux"*)
TEST_TARGET=x86_64-unknown-linux-gnu cargo test --verbose -- --nocapture
;;
Expand All @@ -33,11 +32,6 @@ case "${TRAVIS_OS_NAME}" in
;;
esac

# FIXME: Sometimes we couldn't install semverver on Travis' Windows builder.
if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
exit 0
fi

# install
mkdir -p ~/rust/cargo/bin
cp target/debug/cargo-semver ~/rust/cargo/bin
Expand All @@ -46,7 +40,7 @@ cp target/debug/rust-semverver ~/rust/cargo/bin
# become semververver
#
# Note: Because we rely on rust nightly building the previously published
# semver can often fail. To avoid failing the build we first check
# semver can often fail. To avoid failing the build we first check
# if we can compile the previously published version.
if cargo install --root "$(mktemp -d)" semverver > /dev/null 2>/dev/null; then
PATH=~/rust/cargo/bin:$PATH cargo semver | tee semver_out
Expand All @@ -64,5 +58,5 @@ if cargo install --root "$(mktemp -d)" semverver > /dev/null 2>/dev/null; then
exit 1
fi
else
echo 'Failed to check semver-compliance of semverver. Failed to compiled previous version.' >&2
echo 'Failed to check semver-compliance of semverver. Failed to compiled previous version.' >&2
fi
8 changes: 4 additions & 4 deletions src/bin/cargo_semver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ fn main() {
}

let config_res = config.configure(
0, // verbose
0, // verbose
matches.opt_present("q"), // quiet
None, // color
false, // frozen
false, // locked
None, // color
false, // frozen
false, // locked
matches.opt_present("offline"),
&None, // target_dir
&[], // unstable_flags
Expand Down
4 changes: 2 additions & 2 deletions tests/full_cases/log-0.3.4-0.3.8.windows_msvc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ warning: technically breaking changes in `<new::LogRecord<'a> as std::fmt::Debug
|
= note: trait impl generalized or newly added (technically breaking)

warning: technically breaking changes in `<new::LogMetadata<'a> as std::marker::StructuralEq>`
warning: technically breaking changes in `<new::LogMetadata<'a> as std::cmp::Eq>`
--> log-0.3.8\src\lib.rs:552:10
|
552 | #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
Expand Down Expand Up @@ -71,7 +71,7 @@ warning: technically breaking changes in `<new::LogMetadata<'a> as std::fmt::Deb
|
= note: trait impl generalized or newly added (technically breaking)

warning: technically breaking changes in `<new::LogLocation as std::marker::StructuralEq>`
warning: technically breaking changes in `<new::LogLocation as std::cmp::Eq>`
--> log-0.3.8\src\lib.rs:604:30
|
604 | #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
Expand Down