-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: examples for reusable workflows
- Loading branch information
Showing
11 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.github/workflows/oci-factory_build_and_test_eicar_rock.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Warning: This workflow is designed to fail. When merging in a PR, pushing an empty commit will bypass checks and allow the PR to be merged. | ||
name: OCI Factory Workflows - Build and Test EICAR Rock | ||
|
||
on: | ||
push: | ||
paths: | ||
- .github/workflows/build_and_test_eicar_rock.yaml | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: canonical/oci-factory/.github/workflows/Build-Rock.yaml@main | ||
with: | ||
oci-archive-name: "eicar-rock" | ||
rock-repo: canonical/rocks-toolbox | ||
rock-repo-commit: rework_oci-factory_workflow_docs | ||
rockfile-directory: eicar_rock/1.0/ | ||
|
||
test: | ||
uses: canonical/oci-factory/.github/workflows/Test-Rock.yaml@main | ||
needs: [build] | ||
with: | ||
oci-archive-name: "eicar-rock" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: OCI Factory Workflows - Build External Rock | ||
|
||
on: | ||
push: | ||
paths: | ||
- .github/workflows/build_external_rock.yaml | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: canonical/oci-factory/.github/workflows/Build-Rock.yaml@main | ||
with: | ||
oci-archive-name: "chiselled-python" | ||
rock-repo: canonical/chiselled-python | ||
rock-repo-commit: e0943bf2923ef50c9117ac58cd02a86146ece1fb | ||
rockfile-directory: python3.12/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: OCI Factory Workflows - Build Mock Rock | ||
|
||
on: | ||
push: | ||
paths: | ||
- .github/workflows/build_mock_rock.yaml | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: canonical/oci-factory/.github/workflows/Build-Rock.yaml@main | ||
with: | ||
oci-archive-name: "mock-rock" | ||
rock-repo: canonical/rocks-toolbox | ||
rock-repo-commit: main | ||
rockfile-directory: mock_rock/1.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Warning: This workflow is designed to fail. When merging in a PR, pushing an empty commit will bypass checks and allow the PR to be merged. | ||
name: OCI Factory Workflows - Test External Rock | ||
|
||
on: | ||
push: | ||
paths: | ||
- .github/workflows/test_external_rock.yaml | ||
workflow_dispatch: | ||
|
||
env: | ||
VULNERABILITY_REPORT_SUFFIX: '.vulnerability-report.json' | ||
SKOPEO_IMAGE: 'quay.io/skopeo/stable:v1.15.1' | ||
TEST_IMAGE: 'bkimminich/juice-shop' | ||
TEST_IMAGE_FILENAME: 'juice-shop' | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- run: | | ||
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v $PWD:/workdir -w /workdir \ | ||
${{ env.SKOPEO_IMAGE }} \ | ||
copy docker://${{ env.TEST_IMAGE }} \ | ||
oci-archive:test_image | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: test_image | ||
path: test_image | ||
retention-days: 1 | ||
|
||
test: | ||
uses: canonical/oci-factory/.github/workflows/Test-Rock.yaml@main | ||
needs: [setup] | ||
with: | ||
oci-archive-name: test_image | ||
test-black-box: false # will always fail since bkimminich/juice-shop is not a rock. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: eicar-rock | ||
summary: A test rock to check malware scanners | ||
description: An extension of the "Hello World" rock. This rock contains the EICAR test file to test if malware scanners are working as expected | ||
version: "latest" | ||
license: Apache-2.0 | ||
|
||
base: ubuntu@22.04 | ||
platforms: | ||
amd64: | ||
|
||
parts: | ||
hello: | ||
plugin: nil | ||
stage-packages: | ||
- hello | ||
eicar: | ||
plugin: dump | ||
source-type: file | ||
source: eicar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# OCI Factory Reusable Workflow Examples | ||
|
||
This directory contains GitHub workflow examples which integrate reusable workflows | ||
from the [OCI Factory](https://github.com/canonical/oci-factory). | ||
|
||
Brief documentation for reusable these workflows and each example can be found in the | ||
[OCI Factory README](https://github.com/canonical/oci-factory/blob/main/README.md). |
1 change: 1 addition & 0 deletions
1
oci-factory_reuseable_workflow_examples/oci-factory_build_and_test_eicar_rock.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.github/workflows/oci-factory_build_and_test_eicar_rock.yaml |
1 change: 1 addition & 0 deletions
1
oci-factory_reuseable_workflow_examples/oci-factory_build_external_rock.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.github/workflows/oci-factory_build_external_rock.yaml |
1 change: 1 addition & 0 deletions
1
oci-factory_reuseable_workflow_examples/oci-factory_build_mock_rock.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.github/workflows/oci-factory_build_mock_rock.yaml |
1 change: 1 addition & 0 deletions
1
oci-factory_reuseable_workflow_examples/oci-factory_test_external_rock.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.github/workflows/oci-factory_test_external_rock.yaml |