Skip to content

Commit

Permalink
Split out Depscan Rust workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
patchwork01 committed Sep 12, 2024
1 parent f6d5ad4 commit def0004
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 32 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/dep-scan-rust-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Depscan Rust Changes
on:
pull_request:
paths:
- 'rust/**/Cargo.toml'
- '.github/workflows/dep-scan-rust-changes.yaml'
- '.github/workflows/dep-scan.yaml'

jobs:
scan:
uses: ./.github/workflows/dependency-check.yaml
with:
path: rust
11 changes: 11 additions & 0 deletions .github/workflows/dep-scan-rust-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Depscan Rust Nightly
on:
workflow_dispatch: # Allow manual running to refresh/check cache
schedule:
- cron: '0 2 * * *'

jobs:
scan:
uses: ./.github/workflows/dependency-check.yaml
with:
path: rust
37 changes: 37 additions & 0 deletions .github/workflows/dep-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Depscan
on:
workflow_call:
inputs:
path:
required: true
type: string

jobs:
dep-scan:
runs-on: ubuntu-latest
steps:
- name: Delete unnecessary tools folders
run: |
rm -rf /opt/hostedtoolcache
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf "/usr/local/share/boost"
rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- name: Cache VDB home
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vdb
key: ${{ runner.os }}-dep-scan-${{ steps.date.outputs.date }}
restore-keys: |
${{ runner.os }}-dep-scan-
- uses: ./.github/actions/dep-scan
with:
src: /github/workspace/${{ inputs.path }}
env:
VDB_HOME: ${{ github.workspace }}/vdb
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: Upload reports
path: reports
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'java/**/pom.xml'

jobs:
build-cli:
check:
uses: ./.github/workflows/dependency-check.yaml
with:
failOnCacheMiss: true
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: '0 2 * * *'

jobs:
build-cli:
check:
uses: ./.github/workflows/dependency-check.yaml
with:
failOnCacheMiss: false
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check-workflow-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '.github/workflows/dependency-check.yaml'

jobs:
build-cli:
check:
uses: ./.github/workflows/dependency-check.yaml
with:
failOnCacheMiss: false
29 changes: 0 additions & 29 deletions .github/workflows/dependency-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,6 @@ on:
type: boolean

jobs:
dep-scan:
runs-on: ubuntu-latest
steps:
- name: Delete unnecessary tools folders
run: |
rm -rf /opt/hostedtoolcache
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf "/usr/local/share/boost"
rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- name: Cache VDB home
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vdb
key: ${{ runner.os }}-dep-scan-${{ steps.date.outputs.date }}
restore-keys: |
${{ runner.os }}-dep-scan-
- uses: ./.github/actions/dep-scan
with:
src: /github/workspace/rust
env:
VDB_HOME: ${{ github.workspace }}/vdb
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: Upload reports
path: reports

maven:
runs-on: ubuntu-latest

Expand Down

0 comments on commit def0004

Please sign in to comment.