-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Indy2222/feature/ci
- Loading branch information
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Rust | ||
|
||
on: | ||
push | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: --deny warnings | ||
|
||
jobs: | ||
build: | ||
name: Build & Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: clippy | ||
override: true | ||
- name: Rust Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: target | ||
key: tests-${{ runner.os }} | ||
- name: Install Linux Dependencies | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev | ||
- run: rustc --version && cargo --version && cargo clippy --version | ||
- name: Build | ||
run: cargo build --verbose --all-targets --all-features | ||
- name: Store Debug Build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: debug-binary-${{ runner.os }} | ||
retention-days: 1 | ||
path: | | ||
target/debug/de | ||
target/debug/de.exe | ||
- name: Clippy | ||
run: cargo clippy --all-targets --all-features -- --deny warnings | ||
- name: Test | ||
run: cargo test --verbose --all-features | ||
- name: Build Docs | ||
run: cargo doc --no-deps --all-features | ||
|
||
format: | ||
name: Test Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: rustup update | ||
- run: cargo fmt --version | ||
- run: cargo fmt -- --check | ||
|
||
build_release: | ||
name: Release Build | ||
runs-on: ${{ matrix.os }} | ||
if: github.ref == 'refs/heads/main' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- name: Rust Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: target | ||
key: build-release-${{ runner.os }} | ||
- name: Install Linux Dependencies | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev | ||
- run: rustc --version && cargo --version | ||
- name: Build | ||
run: cargo build --release | ||
- name: Store Release Build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: de-binary-${{ runner.os }} | ||
path: | | ||
target/release/de | ||
target/release/de.exe |