Add Github actions for clippy and tests

This commit is contained in:
tux3
2022-08-31 20:11:45 +02:00
parent fa14247664
commit e97603546d
+48
View File
@@ -0,0 +1,48 @@
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We use ready!(), which is in 1.64 only
- uses: actions-rs/toolchain@v1
with:
toolchain: beta
default: true
components: clippy
- name: Test
run: cargo build --all
- name: Test (no features)
run: cargo test --no-default-features
- name: Test (all features)
run: cargo test --all-features
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We use ready!(), which is in 1.64 only
- uses: actions-rs/toolchain@v1
with:
toolchain: beta
default: true
components: clippy
- name: Clippy
run: cargo clippy --all --all-targets -- -D warnings
- name: Clippy (no features)
run: cargo clippy --all --all-targets --no-default-features -- -D warnings
- name: Clippy (XZ compression)
run: cargo clippy --all --all-targets --no-default-features --features lfo-compress-xz -- -D warnings
- name: Clippy (verify hashes)
run: cargo clippy --all --all-targets --no-default-features --features lfo-check-hash -- -D warnings
- name: Clippy (all features)
run: cargo clippy --all --all-targets --all-features -- -D warnings