Add testing to GitHub workflow (#15)

* update workflow and pre-commit to test only unit tests

* Update .github/workflows/checks.yml

Co-authored-by: Adil Hafeez <adil@katanemo.com>

* Update .pre-commit-config.yaml

Co-authored-by: Adil Hafeez <adil@katanemo.com>

* update formatting of comments

* Update .pre-commit-config.yaml

* Update checks.yml

---------

Co-authored-by: Adil Hafeez <adil@katanemo.com>
This commit is contained in:
Aayush 2024-07-18 14:20:33 -07:00 committed by GitHub
parent 7bf77afa0e
commit 31c4ac267a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View file

@ -1,4 +1,4 @@
name: Static Analysis
name: Checks
on: pull_request
@ -25,3 +25,16 @@ jobs:
run: rustup toolchain install stable --profile minimal
- name: Run Rustfmt
run: cd envoyfilter && cargo fmt --all -- --check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
run: rustup toolchain install stable --profile minimal
- name: Run Tests
# --lib is to only test the library, since when integration tests are made,
# they will be in a seperate tests directory
run: cd envoyfilter && cargo test --lib

View file

@ -21,4 +21,6 @@ repos:
name: cargo-test
language: system
types: [file, rust]
entry: bash -c "cd envoyfilter && cargo test --all"
# --lib is to only test the library, since when integration tests are made,
# they will be in a seperate tests directory
entry: bash -c "cd envoyfilter && cargo test --lib"