Skip to content
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
78 changes: 17 additions & 61 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,29 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

name: CI

on:
push:
branches:
- "**"
push: { branches: ["**"] }
pull_request: { branches: ["**"] }

jobs:
check:
name: Check
ci:
name: Rust CI
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Checkout
uses: actions/checkout@v4

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache Cargo
uses: Swatinem/rust-cache@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Format check
run: cargo fmt --all -- --check

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Unit tests
run: cargo test --all --all-features --verbose
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Loader {

/// Read file data into string from path
fn read_file(path: &str) -> Result<String> {
let mut file = File::open(&path)?;
let mut file = File::open(path)?;
let mut data_file = String::new();
file.read_to_string(&mut data_file)?;
Ok(data_file)
Expand Down
Loading