-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alex Bozarth <[email protected]>
- Loading branch information
Showing
3 changed files
with
141 additions
and
15 deletions.
There are no files selected for viewing
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,100 @@ | ||
# This is a template workflow for a new demo | ||
# To get started replace all instances of <demo_name> with the name of your demo below and add the demo to the build.yml workflow | ||
name: <demo_name> | ||
|
||
on: | ||
push: | ||
branches: [ 'main' ] | ||
paths: ['.github/workflows/<demo_name>.yml', '<demo_name>/**'] | ||
pull_request: | ||
branches: [ 'main' ] | ||
paths: ['.github/workflows/<demo_name>.yml', '<demo_name>/**'] | ||
workflow_call: | ||
inputs: | ||
build_main: | ||
description: "Build using liboqs and oqsprovider main branches" | ||
required: false | ||
default: false | ||
type: boolean | ||
release_tag: | ||
description: "Which docker tag to push to" | ||
required: false | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
build_main: | ||
description: "Build using liboqs and oqsprovider main branches" | ||
required: false | ||
default: false | ||
type: boolean | ||
release_tag: | ||
description: "Which docker tag to push to" | ||
required: false | ||
type: string | ||
|
||
env: | ||
build-args: | | ||
LIBOQS_TAG=main | ||
OQSPROVIDER_TAG=main | ||
push: ${{ github.repository == 'open-quantum-safe/oqs-demos' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && inputs.build_main != 'true' }} | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- arch: x86_64 | ||
runner: ubuntu-latest | ||
- arch: arm64 | ||
runner: oqs-arm64 | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/login-action@v3 | ||
if: env.push == 'true' | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
load: true | ||
context: <demo_name> | ||
build-args: | | ||
MAKE_DEFINES=-j4 | ||
${{ (inputs.build_main == 'true') && env.build-args || null }} | ||
tags: <demo_name> | ||
|
||
- name: Test <demo_name> | ||
run: | | ||
echo "Add tests here" | ||
- name: Push Docker image to registries | ||
if: env.push == 'true' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
context: <demo_name> | ||
build-args: | | ||
MAKE_DEFINES=-j4 | ||
${{ (inputs.build_main == 'true') && env.build-args || null }} | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/<demo_name>:${{ inputs.release_tag || 'latest' }}-${{ matrix.arch }} | ||
openquantumsafe/<demo_name>:${{ inputs.release_tag || 'latest' }}-${{ matrix.arch }} | ||
push: | ||
if: ${{ github.repository == 'open-quantum-safe/oqs-demos' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && inputs.build_main != 'true' }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./.github/workflows/manifest | ||
with: | ||
image_name: <demo_name> | ||
release_tag: ${{ inputs.release_tag || 'latest' }} |
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,25 @@ | ||
# Contributing new quantum-safe application integrations | ||
|
||
All submissions must meet acceptance criteria given below. Demos may be removed if they no longer meet the acceptance criteria. | ||
|
||
## Documentation requirements | ||
|
||
- Purpose of integration and upstream (code origin) location must be clearly documented. | ||
- README must contain all steps to build the OQS-enabled code. | ||
- An optional USAGE file must be present if the integration can be built into a docker image. | ||
|
||
## Execution requirements | ||
|
||
- If possible, a Dockerfile should be provided such as to automate the integration completely. In this case, a separate USAGE file must be available that shall document usage of the docker file at [docker hub](https://hub.docker.com/orgs/openquantumsafe/repositories). | ||
- If a docker file is provided, it is expected that build-and-test code is added to the continuous integration environment testing (see below). | ||
|
||
## Maintenance | ||
|
||
We hope the contributor will intend to help update the integration over time as the upstream code bases as well as the underlying algorithms and APIs evolve. | ||
|
||
## Continuous Integration | ||
|
||
Each demo should have it's own GitHub Actions workflow to handle building, testing, and pushing its Docker image. An [example template](.github/workflow-templates/template.yml) is provided to get started. | ||
|
||
A workflow should run the build and test steps whenever changes are detected for the integration in a pull request or push to main. | ||
The push step should only be triggered when the workflow is run on the main branch of the upstream repository (not forks) and not when building against the latest liboqs and oqs-provider code. |
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