-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ci (testing and container builds) (#8)
* add ci (testing and container builds) * helmify binary missing Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
27 changed files
with
2,376 additions
and
6 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,65 @@ | ||
name: build oras-operator | ||
|
||
on: | ||
pull_request: [] | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# Only build arm image on merge, takes too long otherwise | ||
build-arm: | ||
if: (github.event_name != 'pull_request') | ||
runs-on: ubuntu-latest | ||
name: make and build arm | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: GHCR Login | ||
if: (github.event_name != 'pull_request') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add custom buildx ARM builder | ||
run: | | ||
docker buildx create --name armbuilder | ||
docker buildx use armbuilder | ||
docker buildx inspect --bootstrap | ||
- name: Deploy Container | ||
run: make arm-deploy | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
command: [docker] | ||
|
||
name: make and build ${{ matrix.command }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: GHCR Login | ||
if: (github.event_name != 'pull_request') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Container | ||
run: make ${{ matrix.command }}-build | ||
|
||
- name: Deploy Container | ||
if: (github.event_name != 'pull_request') | ||
run: make ${{ matrix.command }}-push |
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,47 @@ | ||
name: helm oras-operator | ||
|
||
on: | ||
pull_request: [] | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Prepare chart | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: GHCR Login | ||
if: (github.event_name != 'pull_request') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install Helm | ||
run: | | ||
export HELM_EXPERIMENTAL_OCI=1 | ||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
- name: Build chart | ||
run: make helm | ||
|
||
- name: Login to Helm | ||
if: (github.event_name != 'pull_request') | ||
env: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "${password}" | helm registry login -u ${username} --password-stdin ${registry} | ||
PKG_RESPONSE=$(helm package ./chart) | ||
echo "$PKG_RESPONSE" | ||
CHART_TAR_GZ=$(basename "$PKG_RESPONSE") | ||
helm push "$CHART_TAR_GZ" oci://ghcr.io/converged-computing/oras-operator-helm |
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,47 @@ | ||
name: test oras-operator | ||
|
||
on: | ||
pull_request: [] | ||
|
||
jobs: | ||
formatting: | ||
name: Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup black linter | ||
run: conda create --quiet --name black pyflakes | ||
|
||
- name: Check Spelling | ||
uses: crate-ci/typos@7ad296c72fa8265059cc03d1eda562fbdfcd6df2 # v1.9.0 | ||
with: | ||
files: ./README.md ./docs/*.md ./docs/*/*.md ./docs/*/*/*.md | ||
|
||
unit-tests: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: fmt check | ||
run: make fmt | ||
|
||
# These aren't written yet | ||
- name: Run Unit tests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: make test | ||
|
||
# Ensure build-config is the same as the one we have | ||
- name: Check Updated oras-operator.yaml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cp examples/dist/oras-operator.yaml /tmp/oras-operator.yaml | ||
make build-config | ||
diff examples/dist/oras-operator.yaml /tmp/oras-operator.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,111 @@ | ||
name: oras operator tag and release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_tag: | ||
description: Custom release tag | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
build-arm: | ||
runs-on: ubuntu-latest | ||
name: make and build arm | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Set tag | ||
run: | | ||
echo "Tag for release is ${{ inputs.release_tag }}" | ||
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV} | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: GHCR Login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add custom buildx ARM builder | ||
run: | | ||
docker buildx create --name armbuilder | ||
docker buildx use armbuilder | ||
docker buildx inspect --bootstrap | ||
- name: Deploy Container | ||
env: | ||
tag: ${{ env.tag }} | ||
run: make arm-deploy ARMIMG=ghcr.io/converged-computing/oras-operator:${tag}-arm | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
command: [docker] | ||
name: make and build ${{ matrix.command }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.20 | ||
- name: Set tag | ||
run: | | ||
echo "Tag for release is ${{ inputs.release_tag }}" | ||
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV} | ||
- name: GHCR Login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Container | ||
env: | ||
tag: ${{ env.tag }} | ||
run: | | ||
image=ghcr.io/converged-computing/oras-operator-${{ matrix.command }}:v${tag} | ||
img=ghcr.io/converged-computing/oras-operator:v${tag} | ||
make ${{ matrix.command }}-build BUNDLE_IMG=${image} IMG=${img} CATALOG_IMG=${image} | ||
- name: Deploy Container | ||
env: | ||
tag: ${{ env.tag }} | ||
run: | | ||
image=ghcr.io/converged-computing/oras-operator-${{ matrix.command }}:v${tag} | ||
img=ghcr.io/converged-computing/oras-operator:v${tag} | ||
make ${{ matrix.command }}-push BUNDLE_IMG=${image} IMG=${img} CATALOG_IMG=${image} | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ^1.19 | ||
- name: Set tag | ||
run: | | ||
echo "Tag for release is ${{ inputs.release_tag }}" | ||
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV} | ||
- name: Build release manifests | ||
env: | ||
tag: ${{ env.tag }} | ||
run: | | ||
make build-config-arm ARMIMG=ghcr.io/converged-computing/oras-operator:${tag}-arm | ||
make build-config IMG=ghcr.io/converged-computing/oras-operator:v${tag} | ||
- name: Release oras Operator | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ORAS Operator Release v${{ env.tag }} | ||
tag_name: ${{ env.tag }} | ||
generate_release_notes: true | ||
files: | | ||
examples/dist/oras-operator-arm.yaml | ||
examples/dist/oras-operator.yaml | ||
env: | ||
GITHUB_REPOSITORY: converged-computing/oras-operator |
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,17 @@ | ||
# CHANGELOG | ||
|
||
This is a manually generated log to track changes to the repository for each release. | ||
Each section should include general headers such as **Implemented enhancements** | ||
and **Merged pull requests**. Critical items to know are: | ||
|
||
- renamed commands | ||
- deprecated / removed commands | ||
- changed defaults | ||
- backward incompatible changes | ||
- migration guidance | ||
- changed behaviour | ||
|
||
Releases coincide with versions released as tags on Github. | ||
|
||
## [0.0.x](https://github.com/converged-computing/oras-operator/tree/main) (0.0.x) | ||
- Skeleton release (0.0.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
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
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 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,21 @@ | ||
apiVersion: v2 | ||
name: chart | ||
description: A Helm chart for Kubernetes | ||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" |
Oops, something went wrong.