Add .github/workflows/rust.yaml
This commit is contained in:
@@ -0,0 +1,59 @@
|
|||||||
|
name: Rust
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main, master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Customize the profile here (e.g., release, debug)
|
||||||
|
PROFILE: release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Rust (Ubuntu)
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Install Rust (macOS)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release # Or --debug, depending on the env.PROFILE
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --release # Or --debug, depending on the env.PROFILE
|
||||||
|
|
||||||
|
- name: Clippy check (optional)
|
||||||
|
# Uncomment to enable Clippy linting
|
||||||
|
# uses: actions-rs/clippy-check@v1
|
||||||
|
# with:
|
||||||
|
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# args: -- -D warnings
|
||||||
|
|
||||||
|
- name: Generate code coverage (optional)
|
||||||
|
# Uncomment to generate code coverage reports (requires additional setup)
|
||||||
|
# uses: codecov/codecov-action@v3
|
||||||
Reference in New Issue
Block a user