Skip to content

Commit

Permalink
Merge pull request #44 from LukasKalbertodt/gh-actions
Browse files Browse the repository at this point in the history
Move to GitHub Actions for CI (plus minor improvements)
  • Loading branch information
LukasKalbertodt authored Oct 15, 2020
2 parents 1c7ad55 + 5920a16 commit 7e6d29c
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 56 deletions.
10 changes: 5 additions & 5 deletions ci/check-basic-style.sh → .github/check-basic-style.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Checks
# Checks:
# - trailing whitespaces (not allowed)
# - single trailing newline (required)
# - bad windows/mac line endings
Expand All @@ -11,7 +11,7 @@
COLS=100
FOLDER="."
FILES='.+\.\(rs\|toml\)'
EXCLUDE='^\(\.\/\)?target\/.*'
EXCLUDE='^\(\.\/\)?\(fuzz\/\)?target\/.*'


# Exit script on the first error
Expand Down Expand Up @@ -60,7 +60,7 @@ fi

### windows and mac OS line endings =======================
echo ""
echo "=== Searching for files with wrong line endings ==================="
echo "=== Searching for files with wrong line endings ======================="

FOUNDLE=0
for f in $(find $FOLDER -regex $FILES -not -regex $EXCLUDE); do
Expand All @@ -78,9 +78,9 @@ else
ERROR=1
fi

## windows and mac OS line endings =======================
## tab characters =======================
echo ""
echo "=== Searching for files with tab chars ==================="
echo "=== Searching for files with tab characters ==========================="

FOUNDTAB=0
for f in $(find $FOLDER -regex $FILES -not -regex $EXCLUDE); do
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
pull_request:
push:
branches: [ master ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings

jobs:
style:
name: 'Check basic style'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Check basic style
run: ./.github/check-basic-style.sh

check:
name: 'Build & test'
runs-on: ubuntu-20.04
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
- name: Prepare cache key
run: |
cargo generate-lockfile
cp Cargo.lock cache-fingerprint
echo $RUSTFLAGS >> cache-fingerprint
echo $(rustc -V) >> cache-fingerprint
- name: Restore cargo cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('cache-fingerprint') }}
- name: Build
run: cargo build
- name: Build benchmarks
run: cargo build --benches --features=nightly-bench
if: matrix.rust == 'nightly'
- name: Run tests
run: cargo test
- name: Generate docs
run: cargo doc

# We do not use a cache here as Miri prefers a clean working directory anyway.
check-miri:
name: 'Run tests with miri'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: miri
- name: "Miri setup"
run: cargo miri setup
- name: "Run tests with miri"
run: cargo miri test
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ crate and learn everything anew instead of digging through this changelog.


[Unreleased]: https://github.com/LukasKalbertodt/stable-vec/compare/v0.4.0...HEAD
[0.3.2]: https://github.com/LukasKalbertodt/stable-vec/compare/v0.3.2...v0.4.0
[0.4.0]: https://github.com/LukasKalbertodt/stable-vec/compare/v0.3.2...v0.4.0
[0.3.2]: https://github.com/LukasKalbertodt/stable-vec/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/LukasKalbertodt/stable-vec/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/LukasKalbertodt/stable-vec/compare/v0.2.2...v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ nightly-bench = ["criterion/real_blackbox"]
no-std-compat = { version = "0.2.0", features = ["alloc"] }

[dev-dependencies]
quickcheck = "0.8"
quickcheck_macros = "0.8"
quickcheck = "0.9"
quickcheck_macros = "0.9"
criterion = { version = "0.2" }

[[bench]]
Expand Down
14 changes: 0 additions & 14 deletions ci/run-miri-tests.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! There are multiple ways to implement the "stable vector" interface, each
//! with different performance characteristics. The `Core` is this
//! implementation, making the stable vector work. See [`Core`][core::Core] for
//! implementation, making the stable vector work. See [`Core`][Core] for
//! more information.
use std::{
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
//! code that is not necessary and you can show that removing it does not
//! decrease execution speed, please also open an issue or PR!
//!
#![deny(missing_debug_implementations)]
#![deny(intra_doc_link_resolution_failure)]
#![deny(broken_intra_doc_links)]

// ----- Deal with `no_std` stuff --------------------------------------------
#![no_std]
Expand Down

0 comments on commit 7e6d29c

Please sign in to comment.