diff --git a/.github/workflows/test-trivy.yaml b/.github/workflows/test-trivy.yaml index d6b82e60d..bb5c18a14 100644 --- a/.github/workflows/test-trivy.yaml +++ b/.github/workflows/test-trivy.yaml @@ -51,6 +51,40 @@ jobs: - name: Run unit tests run: mage test:unit + integration: + name: Integration Tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ env.TRIVY_DIR }} + steps: + - name: Checkout defsec + uses: actions/checkout@v3 + with: + repository: aquasecurity/defsec + path: ${{ env.DEFSEC_DIR }} + + - name: Checkout trivy + uses: actions/checkout@v3 + with: + repository: aquasecurity/trivy + path: ${{ env.TRIVY_DIR }} + + - uses: actions/setup-go@v4 + with: + go-version-file: "${{ env.TRIVY_DIR }}/go.mod" + cache-dependency-path: "${{ env.TRIVY_DIR }}/go.sum" + + - name: Replace defsec + run: | + go mod edit -replace "github.com/aquasecurity/defsec=../${{ env.DEFSEC_DIR }}" + + - name: Install tools + uses: aquaproj/aqua-installer@v2.1.2 + with: + aqua_version: v2.8.0 + working_directory: ${{ env.TRIVY_DIR }} + - name: Run integration tests run: mage test:integration