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
33 changes: 11 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ jobs:
run: cargo clippy -- -D warnings
- name: Check formatting
run: cargo fmt -- --check

coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Run coverage
run: cargo tarpaulin --out Xml --output-dir coverage
- name: Code coverage
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --out Xml --output-dir coverage
- name: Upload to codecov
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
uses: codecov/codecov-action@v4
with:
files: ./coverage/cobertura.xml
Expand All @@ -52,20 +47,15 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@stable
- name: Build release
run: cargo build --release --verbose

publish-check:
name: Publish Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
- name: Check package
if: matrix.os == 'ubuntu-latest'
run: cargo package --allow-dirty
- name: Check publish
run: cargo publish --dry-run
if: matrix.os == 'ubuntu-latest'
run: cargo publish --dry-run --allow-dirty

release:
name: Release
Expand Down Expand Up @@ -93,9 +83,8 @@ jobs:
asset_name: rpg-windows-x86_64.exe
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
Expand Down
8 changes: 4 additions & 4 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::process::Command;

#[test]
fn test_basic_generation() {
let output = Command::new("./target/release/rpg")
let output = Command::new(env!("CARGO_BIN_EXE_rpg"))
.args(&["3", "--quiet"])
.output()
.expect("Failed to execute command");
Expand All @@ -21,7 +21,7 @@ fn test_basic_generation() {

#[test]
fn test_length_option() {
let output = Command::new("./target/release/rpg")
let output = Command::new(env!("CARGO_BIN_EXE_rpg"))
.args(&["1", "--length", "20", "--quiet"])
.output()
.expect("Failed to execute command");
Expand Down Expand Up @@ -55,12 +55,12 @@ fn test_length_option() {

#[test]
fn test_seed_reproducibility() {
let output1 = Command::new("./target/release/rpg")
let output1 = Command::new(env!("CARGO_BIN_EXE_rpg"))
.args(&["1", "--seed", "12345", "--quiet"])
.output()
.expect("Failed to execute command");

let output2 = Command::new("./target/release/rpg")
let output2 = Command::new(env!("CARGO_BIN_EXE_rpg"))
.args(&["1", "--seed", "12345", "--quiet"])
.output()
.expect("Failed to execute command");
Expand Down
Loading