diff --git a/.github/workflows/oci-factory_build_and_test_eicar_rock.yaml b/.github/workflows/oci-factory_build_and_test_eicar_rock.yaml new file mode 100644 index 0000000..28c36eb --- /dev/null +++ b/.github/workflows/oci-factory_build_and_test_eicar_rock.yaml @@ -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" diff --git a/.github/workflows/oci-factory_build_external_rock.yaml b/.github/workflows/oci-factory_build_external_rock.yaml new file mode 100644 index 0000000..8471318 --- /dev/null +++ b/.github/workflows/oci-factory_build_external_rock.yaml @@ -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/ diff --git a/.github/workflows/oci-factory_build_mock_rock.yaml b/.github/workflows/oci-factory_build_mock_rock.yaml new file mode 100644 index 0000000..138128c --- /dev/null +++ b/.github/workflows/oci-factory_build_mock_rock.yaml @@ -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 diff --git a/.github/workflows/oci-factory_test_external_rock.yaml b/.github/workflows/oci-factory_test_external_rock.yaml new file mode 100644 index 0000000..3c60c49 --- /dev/null +++ b/.github/workflows/oci-factory_test_external_rock.yaml @@ -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. + diff --git a/eicar_rock/1.0/eicar b/eicar_rock/1.0/eicar new file mode 100644 index 0000000..a2463df --- /dev/null +++ b/eicar_rock/1.0/eicar @@ -0,0 +1 @@ +X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* \ No newline at end of file diff --git a/eicar_rock/1.0/rockcraft.yaml b/eicar_rock/1.0/rockcraft.yaml new file mode 100644 index 0000000..636bf57 --- /dev/null +++ b/eicar_rock/1.0/rockcraft.yaml @@ -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 diff --git a/oci-factory_reuseable_workflow_examples/README.md b/oci-factory_reuseable_workflow_examples/README.md new file mode 100644 index 0000000..7064c2c --- /dev/null +++ b/oci-factory_reuseable_workflow_examples/README.md @@ -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). diff --git a/oci-factory_reuseable_workflow_examples/oci-factory_build_and_test_eicar_rock.yaml b/oci-factory_reuseable_workflow_examples/oci-factory_build_and_test_eicar_rock.yaml new file mode 120000 index 0000000..43a0bf4 --- /dev/null +++ b/oci-factory_reuseable_workflow_examples/oci-factory_build_and_test_eicar_rock.yaml @@ -0,0 +1 @@ +../.github/workflows/oci-factory_build_and_test_eicar_rock.yaml \ No newline at end of file diff --git a/oci-factory_reuseable_workflow_examples/oci-factory_build_external_rock.yaml b/oci-factory_reuseable_workflow_examples/oci-factory_build_external_rock.yaml new file mode 120000 index 0000000..a230a06 --- /dev/null +++ b/oci-factory_reuseable_workflow_examples/oci-factory_build_external_rock.yaml @@ -0,0 +1 @@ +../.github/workflows/oci-factory_build_external_rock.yaml \ No newline at end of file diff --git a/oci-factory_reuseable_workflow_examples/oci-factory_build_mock_rock.yaml b/oci-factory_reuseable_workflow_examples/oci-factory_build_mock_rock.yaml new file mode 120000 index 0000000..123ff78 --- /dev/null +++ b/oci-factory_reuseable_workflow_examples/oci-factory_build_mock_rock.yaml @@ -0,0 +1 @@ +../.github/workflows/oci-factory_build_mock_rock.yaml \ No newline at end of file diff --git a/oci-factory_reuseable_workflow_examples/oci-factory_test_external_rock.yaml b/oci-factory_reuseable_workflow_examples/oci-factory_test_external_rock.yaml new file mode 120000 index 0000000..cee8327 --- /dev/null +++ b/oci-factory_reuseable_workflow_examples/oci-factory_test_external_rock.yaml @@ -0,0 +1 @@ +../.github/workflows/oci-factory_test_external_rock.yaml \ No newline at end of file