[GHA] Cache trivy db #1620
Workflow file for this run
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: OpenVINO tokenizers sdl tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- master | |
- 'releases/**' | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
concurrency: | |
# github.ref is not unique in post-commit | |
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-linux-sdl | |
cancel-in-progress: true | |
env: | |
PYTHON_VERSION: '3.11' | |
jobs: | |
sdl_tests: | |
name: SDL tests | |
timeout-minutes: 10 | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Openvino tokenizers sources and tests | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pip' | |
- name: Install Python tests dependencies | |
run: | | |
python3 -m pip install bandit | |
- name: Tokenizers Bandit tests | |
run: | | |
bandit -c pyproject.toml -r python | |
- name: Setup trivy cache | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | |
with: | |
save-always: true | |
path: .cache/trivy/db | |
key: tivy-cache-${{ github.sha }} | |
restore-keys: | | |
tivy-cache | |
- name: Run Trivy vulnerability scanner in fs mode | |
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0 | |
with: | |
scan-type: 'fs' | |
scan-ref: '.' | |
- name: Dependency Review | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0 | |
with: | |
config-file: './.github/dependency_review.yml' | |