Vulnerable functionality for java (maven focused) (#81) #908
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: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
cli: | |
name: CLI | |
strategy: | |
matrix: | |
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set git to use LF | |
run: | | |
git config --global core.autocrlf input | |
git config --global core.eol lf | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/Library/Caches/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ matrix.os }}-go | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: bash scripts/test_cli.sh | |
env: | |
TEST_COVERAGE_THRESHOLD: 90 | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
name: coverage.html | |
path: coverage.html | |
retention-days: 2 | |
- name: E2E - scan | |
run: go run cmd/debricked/main.go scan internal/file/testdata/misc -e requirements.txt -t ${{ secrets.DEBRICKED_TOKEN }} -r debricked/cli-test -c E2E-test-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} | |
vulnfunc-e2e: | |
name: Vulnfunc E2E | |
strategy: | |
matrix: | |
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] | |
java: [11, 17, 20] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/Library/Caches/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ matrix.os }}-go | |
- name: Build | |
run: go build -v ./... | |
- name: Set up Java ${{matrix.java}} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{matrix.java}} | |
distribution: 'temurin' | |
- name: Install Debricked CLI | |
run: go install -ldflags "-X main.version=${GITHUB_REF#refs/heads/}" ./cmd/debricked | |
- name: Callgraph E2E | |
run: ./scripts/test_e2e_callgraph_java_version.sh ${{matrix.java}} | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.52 |