-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from msherif1234/gh
enable GH actions workflow
- Loading branch information
Showing
27 changed files
with
4,182 additions
and
0 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,14 @@ | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
groups: | ||
production-dependencies: | ||
dependency-type: production | ||
development-dependencies: | ||
dependency-type: development |
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,122 @@ | ||
name: bpfman-image-build | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [main] | ||
tags: | ||
- v* | ||
|
||
pull_request: | ||
paths: [.github/workflows/image-build.yaml] | ||
|
||
jobs: | ||
build-and-push-images: | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write # needed for signing the images with GitHub OIDC Token | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
- registry: quay.io | ||
build_language: go | ||
repository: bpfman | ||
image: bpfman-agent | ||
dockerfile: ./Containerfile.bpfman-agent | ||
context: . | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
build_language: go | ||
repository: bpfman | ||
image: bpfman-operator | ||
dockerfile: ./Containerfile.bpfman-operator | ||
context: . | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
build_language: go | ||
repository: bpfman | ||
image: bpfman-operator-bundle | ||
context: . | ||
dockerfile: ./Containerfile.bundle | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
name: Build Image (${{ matrix.image.image }}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
if: ${{ matrix.image.build_language == 'go' }} | ||
with: | ||
# prettier-ignore | ||
go-version: '1.21' # yamllint disable-line rule:quoted-strings | ||
|
||
- uses: sigstore/[email protected] | ||
|
||
- name: Generate olm bundle on disk | ||
if: ${{ matrix.image.image == 'bpfman-operator-bundle' }} | ||
run: | | ||
make bundle | ||
- name: Login to quay.io/bpfman | ||
uses: redhat-actions/podman-login@v1 | ||
if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfman'}} | ||
with: | ||
registry: ${{ matrix.image.registry }} | ||
username: ${{ secrets.BPFMAN_USERNAME }} | ||
password: ${{ secrets.BPFMAN_ROBOT_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for image | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ matrix.image.registry }}/${{ matrix.image.repository }}/${{ matrix.image.image }} | ||
tags: ${{ matrix.image.tags }} | ||
|
||
- name: Build image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ matrix.image.image }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
containerfiles: ${{ matrix.image.dockerfile }} | ||
build-args: ${{ matrix.image.build_args }} | ||
context: ${{ matrix.image.context }} | ||
|
||
- name: Push to registry | ||
id: push-image | ||
uses: redhat-actions/push-to-registry@v2 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Sign the images with GitHub OIDC Token | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
readarray -t tags <<<"${{ steps.meta.outputs.tags }}" | ||
for tag in ${tags[@]}; do | ||
cosign sign -y "${tag}@${{ steps.push-image.outputs.digest }}" | ||
done |
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,39 @@ | ||
name: pull request checks | ||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
|
||
jobs: | ||
build-lint-test: | ||
name: Build, lint, test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.21','1.22'] | ||
steps: | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: check format | ||
run: make fmt && git add -A && git diff --exit-code | ||
- name: build, lint, test | ||
run: make build lint test | ||
- name: check clean vendors | ||
run: go mod vendor | ||
- name: Report coverage | ||
if: ${{ matrix.go == '1.21' }} | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
files: ./cover.out | ||
flags: unittests | ||
fail_ci_if_error: true | ||
verbose: true | ||
|
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
152 changes: 152 additions & 0 deletions
152
bundle/manifests/bpfman-agent-role_rbac.authorization.k8s.io_v1_clusterrole.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,152 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
creationTimestamp: null | ||
name: bpfman-agent-role | ||
rules: | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- bpfprograms | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- bpfprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- bpfprograms/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- fentryprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- fentryprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- fexitprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- fexityprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- kprobeprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- kprobeprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- tcprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- tcprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- tracepointprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- tracepointprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- uprobeprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- uprobeprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- xdpprograms | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- bpfman.io | ||
resources: | ||
- xdpprograms/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- secrets | ||
verbs: | ||
- get |
19 changes: 19 additions & 0 deletions
19
...e/manifests/bpfman-agent-rolebinding_rbac.authorization.k8s.io_v1_clusterrolebinding.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,19 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: bpfman-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: clusterrolebinding | ||
app.kubernetes.io/part-of: bpfman-operator | ||
name: bpfman-agent-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: bpfman-agent-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: bpfman-daemon | ||
namespace: openshift-bpfman |
19 changes: 19 additions & 0 deletions
19
bundle/manifests/bpfman-agent-rolebinding_rbac.authorization.k8s.io_v1_rolebinding.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,19 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: bpfman-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/name: rolebinding | ||
app.kubernetes.io/part-of: bpfman-operator | ||
name: bpfman-agent-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: bpfman-agent-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: bpfman-daemon | ||
namespace: openshift-bpfman |
Oops, something went wrong.