Skip to content

Commit

Permalink
Fix reusable workflow inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
petrutlucian94 committed Dec 11, 2024
1 parent f2d409e commit 8d6fe39
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
echo "snap-artifact=$out_snap" >> "$GITHUB_OUTPUT"
- name: Uploading snap
needs: build
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.snap-artifact }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/get-e2e-test-tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Build snap
runs-on: ubuntu-latest
outputs:
test-tags: ${{ steps.get-tags.outputs.snap-artifact }}
test-tags: ${{ steps.get-tags.outputs.test-tags }}
steps:
- name: Checking out repo
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-informing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
matrix:
os: ["ubuntu:20.04"]
patch: ["moonray"]
needs: build
needs: [build-snap, get-e2e-test-tags]
uses: ./.github/workflows/run-e2e-tests.yaml
with:
arch: amd64
os: ${{ matrix.os }}
test-tags: ${{ jobs.get-e2e-test-tags.outputs.test-tags}}
test-tags: ${{ needs.get-e2e-test-tags.outputs.test-tags}}
artifact: k8s-${{ matrix.patch }}.snap
10 changes: 5 additions & 5 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04"]
needs: build
needs: [build-snap, get-e2e-test-tags]
uses: ./.github/workflows/run-e2e-tests.yaml
with:
arch: amd64
os: ${{ matrix.os }}
test-tags: ${{ jobs.get-e2e-test-tags.outputs.test-tags}}
artifact: ${{ jobs.build-snap.outputs.snap-artifact}}
test-tags: ${{ needs.get-e2e-test-tags.outputs.test-tags}}
artifact: ${{ needs.build-snap.outputs.snap-artifact}}

security-scan:
name: Security scan
needs: build
needs: build-snap
uses: ./.github/workflows/security-scan.yaml
with:
artifact: ${{ jobs.build-snap.outputs.snap-artifact}}
artifact: ${{ needs.build-snap.outputs.snap-artifact}}
3 changes: 2 additions & 1 deletion .github/workflows/run-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ jobs:
- name: Install tox
run: pip install tox
- name: Run e2e tests
needs: download-snap
env:
TEST_SNAP: ${{ steps.download-snap.outputs.snap-artifact }}
TEST_SNAP: ${{ needs.download-snap.outputs.snap-artifact }}
TEST_SUBSTRATE: lxd
TEST_LXD_IMAGE: ${{ inputs.os }}
TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
run: |
cp trivy-k8s-repo-scan--results.sarif ./manual-trivy/sarifs/
- name: Run Trivy vulnerability scanner on the snap
needs: download-snap
run: |
for var in $(env | grep -o '^TRIVY_[^=]*'); do
unset "$var"
done
cp ${{ steps.download-snap.outputs.snap-artifact }} .
cp ${{ needs.download-snap.outputs.snap-artifact }} .
unsquashfs `basename ${{ steps.download-snap.outputs.snap-artifact }}`
./manual-trivy/trivy --db-repository public.ecr.aws/aquasecurity/trivy-db rootfs ./squashfs-root/ --format sarif > ./manual-trivy/sarifs/snap.sarif
- name: Upload Trivy scan results to GitHub Security tab
Expand Down

0 comments on commit 8d6fe39

Please sign in to comment.