This is an automated email from the ASF dual-hosted git repository.
sciabarracom pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 7e47d25 aligning workflow (#126)
7e47d25 is described below
commit 7e47d2513f01cb11a19c276fb7fb2a9590256833
Author: Michele Sciabarra <[email protected]>
AuthorDate: Tue Sep 8 07:22:45 2026 +0200
aligning workflow (#126)
Co-authored-by: Michele Sciabarra <[email protected]>
---
.asf.yaml | 31 ---------------
.github/kind.yaml | 2 +-
.github/workflows/check.yml | 44 ++++++++++-----------
.github/workflows/image.yml | 94 +++++++++++++++++++++++++++++++++------------
4 files changed, 92 insertions(+), 79 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
deleted file mode 100644
index 3cc9157..0000000
--- a/.asf.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-github:
- protected_branches:
- 0.9.0:
- required_pull_request_reviews:
- required_approving_review_count: 1
-
- main:
- required_linear_history: true
- required_status_checks:
- strict: true
- required_pull_request_reviews:
- required_approving_review_count: 1
- dismiss_stale_reviews: true
- required_conversation_resolution: true
diff --git a/.github/kind.yaml b/.github/kind.yaml
index 7011e9a..7576197 100644
--- a/.github/kind.yaml
+++ b/.github/kind.yaml
@@ -24,7 +24,7 @@ nodes:
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
- node-labels:
"ingress-ready=true,nuvolaris.io/apihost=localhost,nuvolaris.io/apiport=3233,nuvolaris.io/protocol=http,nuvolaris.io/kube=kind,nuvolaris.io/hostpath=data"
+ node-labels:
"ingress-ready=true,openserverless.io/apihost=localhost,openserverless.io/apiport=3233,openserverless.io/protocol=http,openserverless.io/kube=kind,openserverless.io/hostpath=data"
- role: worker
extraMounts:
- hostPath: /tmp
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index b486382..feea6e0 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -16,41 +16,48 @@
# under the License.
#
-name: openserverless-operator-check
-on:
- push:
- branches: [main]
+name: Check
+on:
pull_request:
- branches: [main]
+ workflow_dispatch:
jobs:
check:
name: Check OpenServerless Operator
runs-on: ubuntu-22.04
+ permissions:
+ contents: read
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v7
with:
submodules: recursive
- - name: License
- uses: apache/skywalking-eyes@main
+ - name: License
+ uses: apache/[email protected]
- name: Assign TAG
run: |
TAG=$(git rev-parse --short HEAD)
echo "IMG_TAG=$TAG" >> "$GITHUB_ENV"
echo "OPERATOR_TAG=$TAG" >> "$GITHUB_ENV"
- - name: Assign Custom Image Name
- if: ${{ github.repository_owner != 'apache'}}
+ - name: Generate .env
run: |
- echo "MY_OPERATOR_IMAGE=${{ vars.MY_OPERATOR_IMAGE }}" >>
"$GITHUB_ENV"
+ OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]'
'[:lower:]')
+ if [ "$OWNER" = "apache" ]; then
+ IMAGE=$(awk -F= '/ARG OPERATOR_IMAGE_DEFAULT=/ { print $2 ; exit
}' Dockerfile)
+ else
+ IMAGE="ghcr.io/$OWNER/openserverless-operator"
+ fi
+ echo "GITHUB_USER=$OWNER" > .env
+ echo "MY_OPERATOR_IMAGE=$IMAGE" >> .env
+ cat .env
- name: Kind
uses: container-tools/[email protected]
with:
version: v0.22.0
- cluster_name: nuvolaris
+ cluster_name: openserverless
config: .github/kind.yaml
- name: Set up Python 3.12
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v7
with:
python-version: 3.12
- name: Setup
@@ -61,18 +68,9 @@ jobs:
run: task build-and-load
- name: AddIngress
run: task kind:ingress
- - name: Ngrok
- if: ${{ env.NGROK == 'on' }}
- run: bash .github/debug-github-actions.sh
- env:
- NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }}
- USER_PASS: ${{ secrets.USER_PASS }}
- - name: Wait
- if: ${{ env.NGROK == 'on' }}
- run: bash .github/wait.sh
- name: Unit Test
run: task utest
continue-on-error: false
- name: Integration Test
run: task itest
- continue-on-error: false
+ continue-on-error: false
diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml
index c8f72f7..b5ba46e 100644
--- a/.github/workflows/image.yml
+++ b/.github/workflows/image.yml
@@ -16,42 +16,65 @@
# under the License.
#
-name: Build OpenServerless Operator
+name: Build Image
on:
push:
tags:
- - '[0-9]*'
+ - '*.*.*.*'
+ branches-ignore:
+ - '*'
+ workflow_dispatch:
+
jobs:
image:
name: Build OpenServerless Operator Image
runs-on: ubuntu-22.04
+ permissions:
+ contents: write
+ packages: write
steps:
- - name: Remove unnecessary files
- run: |
- sudo rm -rf /usr/share/dotnet
- sudo rm -rf "$AGENT_TOOLSDIRECTORY"
+ #- name: Remove unnecessary files
+ # run: |
+ # sudo rm -rf /usr/share/dotnet
+ # sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v7
with:
submodules: recursive
+ # full history and tags: "task tag" replaces the existing tags
+ # and "git describe" needs them to be present
+ fetch-depth: 0
- name: License
- uses: apache/skywalking-eyes@main
- - name: Assign TAG from pull request
- if: ${{ github.event_name == 'pull_request' }}
+ uses: apache/[email protected]
+ # Manual run: create a new snapshot tag on the current HEAD and push it.
+ # The push of the tag does not start another run (GITHUB_TOKEN pushes do
+ # not trigger workflows), so this same run goes on and builds it.
+ - name: Tag HEAD (manual run)
+ if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
- echo "IMG_TAG=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
+ # task is installed later by cisetup.sh, get it now
+ sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" --
-d -b /usr/local/bin
+ git config user.name "github-actions[bot]"
+ git config user.email
"41898282+github-actions[bot]@users.noreply.github.com"
+ task tag
+ task ci
- name: Assign TAG from push
- if: ${{ github.event_name != 'pull_request' }}
run: |
echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
- #- name: Assign Custom Image Name
- # if: ${{ github.repository_owner != 'apache'}}
- # run: |
- # echo "MY_OPERATOR_IMAGE=ghcr.io/${{ github.repository_owner }}/${{
github.event.repository.name }}" >> "$GITHUB_ENV"
- # echo "IMAGE_REGISTRY=ghcr.io" >> "$GITHUB_ENV"
+ - name: Generate .env
+ run: |
+ OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]'
'[:lower:]')
+ if [ "$OWNER" = "apache" ]; then
+ IMAGE=$(awk -F= '/ARG OPERATOR_IMAGE_DEFAULT=/ { print $2 ; exit
}' Dockerfile)
+ else
+ IMAGE="ghcr.io/$OWNER/openserverless-operator"
+ fi
+ echo "GITHUB_USER=$OWNER" > .env
+ echo "MY_OPERATOR_IMAGE=$IMAGE" >> .env
+ cat .env
- name: Set up Python 3.12
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v7
with:
python-version: 3.12
- name: Setup
@@ -60,7 +83,7 @@ jobs:
uses: container-tools/[email protected]
with:
version: v0.22.0
- cluster_name: nuvolaris
+ cluster_name: openserverless
config: .github/kind.yaml
- name: Install
run: poetry install
@@ -74,19 +97,42 @@ jobs:
#- name: Integration Test
# run: task itest
# continue-on-error: false
- - name: Show Image Registry
- run: echo "IMAGE_REGISTRY=${{ env.IMAGE_REGISTRY }}"
+
+ - name: Select registry
+ env:
+ DOCKERHUB_REGISTRY: ${{ secrets.DOCKERHUB_REGISTRY }}
+ run: |
+ if [ -n "$DOCKERHUB_REGISTRY" ]; then
+ REGISTRY="$DOCKERHUB_REGISTRY"
+ elif [ "${{ github.repository_owner }}" = "apache" ]; then
+ REGISTRY="docker.io"
+ else
+ REGISTRY="ghcr.io"
+ fi
+ echo "REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
+
+ - name: Select registry credentials
+ run: |
+ if [ "${REGISTRY%%/*}" = "ghcr.io" ]; then
+ echo "REGISTRY_USER=${{ github.actor }}" >> "$GITHUB_ENV"
+ echo "REGISTRY_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
+ else
+ echo "REGISTRY_USER=${{ secrets.DOCKERHUB_USER }}" >> "$GITHUB_ENV"
+ echo "REGISTRY_TOKEN=${{ secrets.DOCKERHUB_TOKEN }}" >>
"$GITHUB_ENV"
+ fi
- name: Registry login
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 #
v4.4.0
with:
- registry: 'docker.io'
- username: ${{ secrets.DOCKERHUB_USER }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
+ registry: ${{ env.REGISTRY }}
+ username: ${{ env.REGISTRY_USER }}
+ password: ${{ env.REGISTRY_TOKEN }}
+
- name: Set up QEMU
uses:
docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0-28
- name: Set up Docker Buildx
uses:
docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
+
- name: Image
run: task buildx-and-push TAG="$IMG_TAG"