CI #43
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
name: CI | |
on: | |
push: | |
# Run on the main branch | |
branches: | |
- main | |
# Also on PRs, just be careful not to publish anything | |
pull_request: | |
# Allow to be called from other workflows (like "release") | |
workflow_call: | |
# But don't trigger on tags, as they are covered by the "release.yaml" workflow | |
# trigger nightly, to ensure it still works with newer data | |
schedule: | |
- cron: "45 2 * * *" | |
jobs: | |
fmt: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check formatting | |
run: | | |
cargo fmt --check | |
check: | |
runs-on: ubuntu-22.04 | |
needs: | |
- fmt | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/.crates.toml | |
~/.cargo/.crates2.json | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }} | |
- name: Check | |
run: cargo check | |
- name: Test | |
run: cargo test | |
- name: Clone test data | |
uses: actions/checkout@v4 | |
with: | |
repository: CVEProject/cvelistV5 | |
path: cvelistV5 | |
- name: Test against CVE database | |
env: | |
CVE_BASE_DIR: ${{github.workspace}}/cvelistV5 | |
run: cargo run --example walkall |