mirror of https://github.com/o2sh/onefetch.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.3 KiB
60 lines
1.3 KiB
name: CI |
|
on: |
|
push: |
|
branches: ["*"] |
|
pull_request: |
|
branches: [main] |
|
|
|
jobs: |
|
build: |
|
runs-on: ${{ matrix.os }} |
|
strategy: |
|
matrix: |
|
os: [ubuntu-latest, windows-latest, macOS-latest] |
|
rust: [stable, nightly] |
|
|
|
steps: |
|
- uses: actions/checkout@v3 |
|
|
|
- name: Restore cargo cache |
|
uses: actions/cache@v3 |
|
with: |
|
path: | |
|
~/.cargo/registry |
|
~/.cargo/git |
|
target |
|
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} |
|
|
|
- name: Install Rust |
|
uses: actions-rs/toolchain@v1 |
|
with: |
|
toolchain: ${{ matrix.rust }} |
|
default: true |
|
profile: minimal |
|
components: clippy |
|
|
|
- name: Build Debug |
|
run: | |
|
rustc --version |
|
cargo build --features=fail-on-deprecated |
|
|
|
- name: Run tests |
|
run: cargo test |
|
|
|
- name: Run clippy |
|
run: cargo clippy |
|
|
|
- name: Run onefetch |
|
run: cargo run |
|
|
|
rustfmt: |
|
name: Rustfmt |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@v3 |
|
- name: Install Rust |
|
uses: actions-rs/toolchain@v1 |
|
with: |
|
toolchain: stable |
|
components: rustfmt |
|
- run: cargo fmt -- --check
|
|
|