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

Commit aa4e42f

Browse files
authored
Merge pull request #128 from JohnTitor/actions
Setup GitHub Actions
2 parents 07a8199 + 0bc63bb commit aa4e42f

File tree

7 files changed

+91
-87
lines changed

7 files changed

+91
-87
lines changed

.github/workflows/ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build_and_test:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
toolchain:
16+
- x86_64-unknown-linux-gnu
17+
- x86_64-apple-darwin
18+
- x86_64-pc-windows-msvc
19+
include:
20+
- toolchain: x86_64-unknown-linux-gnu
21+
builder: ubuntu-latest
22+
os: linux
23+
- toolchain: x86_64-apple-darwin
24+
builder: macos-latest
25+
os: macos
26+
- toolchain: x86_64-pc-windows-msvc
27+
builder: windows-latest
28+
os: windows
29+
30+
name: nightly - ${{ matrix.toolchain }}
31+
runs-on: ${{ matrix.builder }}
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- name: Run tests
37+
run: sh ci/run.sh ${{ matrix.os }}

.github/workflows/style.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Style check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
style_check:
12+
strategy:
13+
fail-fast: false
14+
15+
name: Shellcheck
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Run tests
22+
run: |
23+
shellcheck --version
24+
shellcheck ci/*.sh
25+
26+
- name: Update nightly
27+
run: |
28+
rustup update nightly
29+
30+
- name: rustfmt
31+
run: |
32+
if rustup component add rustfmt; then
33+
cargo fmt --all -- --check
34+
fi
35+
36+
- name: Clippy
37+
run: |
38+
if rustup component add clippy rustc-dev; then
39+
cargo clippy --all
40+
fi

.travis.yml

-46
This file was deleted.

appveyor.yml

-21
This file was deleted.

ci/run.sh

+8-14
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
set -ex
44

5+
OS=${1}
6+
57
export RUST_BACKTRACE=full
68
#export RUST_TEST_NOCAPTURE=1
79

10+
rustup update nightly
11+
812
cargo +nightly install rustup-toolchain-install-master
9-
if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
13+
if [ "${OS}" = "windows" ]; then
1014
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools -i x86_64-pc-windows-msvc
1115
else
1216
rustup-toolchain-install-master -f -n master -c rustc-dev -c llvm-tools
@@ -16,12 +20,7 @@ rustup override set master
1620
cargo build
1721
cargo test --verbose -- --nocapture
1822

19-
# avoid weird cygwin issues for now
20-
if [ -n "$APPVEYOR" ]; then
21-
exit 0
22-
fi
23-
24-
case "${TRAVIS_OS_NAME}" in
23+
case "${OS}" in
2524
*"linux"*)
2625
TEST_TARGET=x86_64-unknown-linux-gnu cargo test --verbose -- --nocapture
2726
;;
@@ -33,11 +32,6 @@ case "${TRAVIS_OS_NAME}" in
3332
;;
3433
esac
3534

36-
# FIXME: Sometimes we couldn't install semverver on Travis' Windows builder.
37-
if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
38-
exit 0
39-
fi
40-
4135
# install
4236
mkdir -p ~/rust/cargo/bin
4337
cp target/debug/cargo-semver ~/rust/cargo/bin
@@ -46,7 +40,7 @@ cp target/debug/rust-semverver ~/rust/cargo/bin
4640
# become semververver
4741
#
4842
# Note: Because we rely on rust nightly building the previously published
49-
# semver can often fail. To avoid failing the build we first check
43+
# semver can often fail. To avoid failing the build we first check
5044
# if we can compile the previously published version.
5145
if cargo install --root "$(mktemp -d)" semverver > /dev/null 2>/dev/null; then
5246
PATH=~/rust/cargo/bin:$PATH cargo semver | tee semver_out
@@ -64,5 +58,5 @@ if cargo install --root "$(mktemp -d)" semverver > /dev/null 2>/dev/null; then
6458
exit 1
6559
fi
6660
else
67-
echo 'Failed to check semver-compliance of semverver. Failed to compiled previous version.' >&2
61+
echo 'Failed to check semver-compliance of semverver. Failed to compiled previous version.' >&2
6862
fi

src/bin/cargo_semver.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ fn main() {
7373
}
7474

7575
let config_res = config.configure(
76-
0, // verbose
76+
0, // verbose
7777
matches.opt_present("q"), // quiet
78-
None, // color
79-
false, // frozen
80-
false, // locked
78+
None, // color
79+
false, // frozen
80+
false, // locked
8181
matches.opt_present("offline"),
8282
&None, // target_dir
8383
&[], // unstable_flags

tests/full_cases/log-0.3.4-0.3.8.windows_msvc

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ warning: technically breaking changes in `<new::LogRecord<'a> as std::fmt::Debug
2323
|
2424
= note: trait impl generalized or newly added (technically breaking)
2525

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

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

0 commit comments

Comments
 (0)