Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocks 1453 - Reusable test rock workflow #294

Merged
merged 44 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b360912
feat: modified test workflow
clay-lake Nov 21, 2024
2c01f8d
feat: make testing workflow reuseable
clay-lake Nov 22, 2024
a18abb8
feat: bump version numbers
clay-lake Nov 22, 2024
9be21e4
test eicar rock
clay-lake Nov 22, 2024
11dee98
test mock rock again
clay-lake Nov 25, 2024
3af011d
feat: merge changes from build-rock
clay-lake Nov 25, 2024
301fa4a
fix: bad workflow-version params
clay-lake Nov 25, 2024
4d84439
feat: test-rock only checks out own ref
clay-lake Nov 25, 2024
0fb3941
minor changes for PR
clay-lake Nov 25, 2024
9753b12
minor changes for PR
clay-lake Nov 25, 2024
0555a7a
fix: bad json path in Vulnerability Scan
clay-lake Nov 25, 2024
2a1c6cb
feat: modified test workflow
clay-lake Nov 21, 2024
9fd85fc
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 25, 2024
3efa2a7
feat: make testing workflow reuseable
clay-lake Nov 22, 2024
5364fd8
feat: bump version numbers
clay-lake Nov 22, 2024
67bd46f
test eicar rock
clay-lake Nov 22, 2024
7b05791
test mock rock again
clay-lake Nov 25, 2024
de62788
feat: merge changes from build-rock
clay-lake Nov 25, 2024
705752e
fix: bad workflow-version params
clay-lake Nov 25, 2024
5841218
feat: test-rock only checks out own ref
clay-lake Nov 25, 2024
a752b7f
minor changes for PR
clay-lake Nov 25, 2024
60aaf4e
minor changes for PR
clay-lake Nov 25, 2024
cdfad74
fix: bad json path in Vulnerability Scan
clay-lake Nov 25, 2024
b98d118
refactor: remove unused test workflow
clay-lake Nov 26, 2024
5912fd7
Merge remote-tracking branch 'origin/main' into ROCKS-1453/reusable_t…
clay-lake Nov 26, 2024
499851c
Merge remote-tracking branch 'origin/ROCKS-1453/reusable_test_rock_wo…
clay-lake Nov 26, 2024
f8686fa
fix: restore validation step
clay-lake Nov 26, 2024
02ca467
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 26, 2024
c4063ba
refactor(Image.yaml): improve *-rock job names
clay-lake Nov 28, 2024
2a4a6d2
refactor(Test-Rock.yaml): fixed comment typo
clay-lake Nov 28, 2024
e8909e0
refactor(Vulnerability-Scan.yaml): convert single quotes to double qu…
clay-lake Nov 28, 2024
f291777
feat: comment out excessive tests
clay-lake Nov 28, 2024
524eb07
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 28, 2024
ed0854b
refactor(.github/workflows/Test-Rock.yaml): applied comment suggestion
clay-lake Nov 29, 2024
b041c46
fix(Vulnerability-Scan.yaml): indentation
clay-lake Nov 29, 2024
557484d
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 29, 2024
78d9c57
test: patch vulnerability scan
clay-lake Nov 29, 2024
649c15e
Merge branch 'ROCKS-1453/reusable_test_rock_workflow' of https://gith…
clay-lake Nov 29, 2024
c85aefb
fix: yaml syntax
clay-lake Nov 29, 2024
4e0841f
fix: bad paramter
clay-lake Nov 29, 2024
b0bc953
fix: add continue on error to jobs
clay-lake Nov 29, 2024
a9ceb37
revert: testing for continuous testing
clay-lake Nov 29, 2024
c91501d
fix: yaml formatting
clay-lake Nov 29, 2024
8e69c1a
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 12 additions & 41 deletions .github/workflows/Image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
exit 1
fi

run-build:
build-rock:
needs: [prepare-build, validate-matrix]
strategy:
fail-fast: true
Expand All @@ -167,45 +167,21 @@ jobs:
lpci-fallback: true
secrets: inherit

tmp-cache-job:
# TODO: This is a temporary job that will be removed when the refactored test job is merged.
# Going forward we download the built rocks from artifacts instead of cache. This job takes
# the uploaded rocks then re-caches them for compatibility.
name: Temporary step to cache rocks
runs-on: ubuntu-22.04
needs: [prepare-build, run-build]
strategy:
fail-fast: true
matrix: ${{ fromJSON(needs.prepare-build.outputs.build-matrix) }}
steps:
- name: Download rock
uses: actions/download-artifact@v4
with:
name: ${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}

- uses: actions/cache/save@v4
with:
key: ${{ github.run_id }}-${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}
path: ${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}

test:
needs: [prepare-build, run-build, tmp-cache-job]
test-rock:
needs: [prepare-build, build-rock]
# TODO: Remove tmp-cache-job when removing the job tmp-cache-job
name: Test
strategy:
fail-fast: true
matrix: ${{ fromJSON(needs.prepare-build.outputs.build-matrix) }}
uses: ./.github/workflows/Tests.yaml
uses: ./.github/workflows/Test-Rock.yaml
with:
oci-image-name: "${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}"
oci-image-path: "oci/${{ matrix.name }}"
test-from: "cache"
cache-key: ${{ github.run_id }}-${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}
oci-archive-name: "${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}"
trivyignore-path: "oci/${{ matrix.name }}/.trivyignore"
secrets: inherit

prepare-upload:
runs-on: ubuntu-22.04
needs: [prepare-build, run-build, test]
needs: [prepare-build, build-rock, test-rock]
name: Prepare upload
if: ${{ inputs.upload || (github.ref_name == 'main' && github.event_name == 'push') }}
env:
Expand Down Expand Up @@ -313,11 +289,9 @@ jobs:
./src/uploads/requirements.sh
pip install -r src/uploads/requirements.txt -r src/image/requirements.txt

- uses: actions/cache/restore@v4
- uses: actions/download-artifact@v4
with:
path: ${{ env.OCI_ARCHIVE_NAME }}
key: ${{ github.run_id }}-${{ matrix.name }}_${{ matrix.commit }}_${{ matrix.dir_identifier }}
fail-on-cache-miss: true
name: ${{ env.OCI_ARCHIVE_NAME }}

- name: Name output artefact
id: rename-oci-archive
Expand Down Expand Up @@ -380,12 +354,9 @@ jobs:

echo "sboms=${all_sboms_zip}" >> "$GITHUB_OUTPUT"

- name: Fetch vulnerability artifacts for hashing
uses: actions/cache/restore@v4
- uses: actions/download-artifact@v4
with:
path: ${{ env.OCI_ARCHIVE_NAME }}${{ env.VULNERABILITY_REPORT_SUFFIX }}
key: ${{ github.run_id }}-${{ env.OCI_ARCHIVE_NAME }}${{ env.VULNERABILITY_REPORT_SUFFIX }}
fail-on-cache-miss: true
name: ${{ env.OCI_ARCHIVE_NAME }}${{ env.VULNERABILITY_REPORT_SUFFIX }}

# https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/generic/README.md
- name: Calculate artefacts hashes
Expand Down Expand Up @@ -615,7 +586,7 @@ jobs:
runs-on: ubuntu-22.04
name: Notify
needs:
[prepare-build, run-build, upload, prepare-releases, generate-provenance]
[prepare-build, build-rock, upload, prepare-releases, generate-provenance]
if: ${{ !cancelled() && contains(needs.*.result, 'failure') && github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
Expand Down
Loading