cve 0.5.0

Mappings for parsing the CVE JSON files
Documentation
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:
  merge_group:
    types:
      - checks_requested
  # 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 * * *"

permissions:
  contents: read

jobs:

  common:
    uses: scm-rs/shared-workflows/.github/workflows/ci.yaml@main

  test:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v5
      - uses: Swatinem/rust-cache@v2

      - name: Clone test data
        uses: actions/checkout@v5
        with:
          repository: CVEProject/cvelistV5
          path: cvelistV5

      - name: Test against CVE database
        env:
          CVE_BASE_DIR: ${{github.workspace}}/cvelistV5
        run: cargo run --example walkall

  ci:
    runs-on: ubuntu-latest
    needs:
      - common
      - test
    if: always()
    steps:
      - name: Success
        if: ${{ !(contains(needs.*.result, 'failure')) }}
        run: exit 0
      - name: Failure
        if: ${{ contains(needs.*.result, 'failure') }}
        run: exit 1