Skip to content

add binary run test to github workflow #304

add binary run test to github workflow

add binary run test to github workflow #304

Workflow file for this run

name: Rust
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run binary for test purpose
run: |
set -e
cargo run --profile dev -- --profile dev
test -f target/generate-rpm/cargo-generate-rpm-*.rpm
rm -f target/generate-rpm/cargo-generate-rpm-*.rpm
cargo run --release -- generate-rpm
test -f target/generate-rpm/cargo-generate-rpm-*.rpm
rm -f target/generate-rpm/cargo-generate-rpm-*.rpm
- name: Package
run: cargo package