Add Github Actions CI
This includes:
* gerrit-verify workflow to verify PRs
* release workflow for pypi release
* dependabot settings to keep actions up to date
* github2gerrit workflow to allow GH PRs to create Gerrit patches
(required for dependabot updates)
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: Ie90db57f1192cdeabd92f3e7daaf97c515241c0f
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..5fe32ab
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,15 @@
+---
+# SPDX-FileCopyrightText: 2025 The Linux Foundation
+# SPDX-License-Identifier: Apache-2.0
+
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
+
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
diff --git a/.github/workflows/call-github2gerrit.yaml b/.github/workflows/call-github2gerrit.yaml
new file mode 100644
index 0000000..e2c7b6e
--- /dev/null
+++ b/.github/workflows/call-github2gerrit.yaml
@@ -0,0 +1,37 @@
+---
+# SPDX-License-Identifier: Apache-2.0
+# Copyright 2026 The Linux Foundation
+
+name: call-github2gerrit
+
+# yamllint disable-line rule:truthy
+on:
+ workflow_dispatch:
+ pull_request_target:
+ types: [opened, reopened, edited, synchronize]
+ branches:
+ - master
+ - main
+
+permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+
+concurrency:
+ # yamllint disable-line rule:line-length
+ group: ${{ github.workflow }}-${{ github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ submit-to-gerrit:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Submit PR to Gerrit
+ id: g2g
+ uses: lfreleng-actions/github2gerrit-action@main
+ with:
+ GERRIT_KNOWN_HOSTS: ${{ vars.GERRIT_KNOWN_HOSTS }}
+ GERRIT_SSH_PRIVKEY_G2G: ${{ secrets.GERRIT_SSH_PRIVKEY_G2G }}
+ GERRIT_SSH_USER_G2G: ${{ vars.GERRIT_SSH_USER_G2G }}
+ GERRIT_SSH_USER_G2G_EMAIL: ${{ vars.GERRIT_SSH_USER_G2G_EMAIL }}
diff --git a/.github/workflows/gerrit-verify.yaml b/.github/workflows/gerrit-verify.yaml
new file mode 100644
index 0000000..d2ef906
--- /dev/null
+++ b/.github/workflows/gerrit-verify.yaml
@@ -0,0 +1,67 @@
+---
+name: Call Verify Workflow(s)
+
+# yamllint disable-line rule:truthy
+on:
+ workflow_dispatch:
+ inputs:
+ GERRIT_BRANCH:
+ description: "Branch that change is against"
+ required: true
+ type: string
+ GERRIT_CHANGE_ID:
+ description: "The ID for the change"
+ required: true
+ type: string
+ GERRIT_CHANGE_NUMBER:
+ description: "The Gerrit number"
+ required: true
+ type: string
+ GERRIT_CHANGE_URL:
+ description: "URL to the change"
+ required: true
+ type: string
+ GERRIT_EVENT_TYPE:
+ description: "Type of Gerrit event"
+ required: true
+ type: string
+ GERRIT_PATCHSET_NUMBER:
+ description: "The patch number for the change"
+ required: true
+ type: string
+ GERRIT_PATCHSET_REVISION:
+ description: "The revision sha"
+ required: true
+ type: string
+ GERRIT_PROJECT:
+ description: "Project in Gerrit"
+ required: true
+ type: string
+ GERRIT_REFSPEC:
+ description: "Gerrit refspec of change"
+ required: true
+ type: string
+
+concurrency:
+ # yamllint disable-line rule:line-length
+ group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
+ cancel-in-progress: true
+
+permissions: read-all
+
+jobs:
+ call-composed-verify:
+ # yamllint disable-line rule:line-length
+ uses: opencord/shared-workflows/.github/workflows/verify-unit-tests.yaml@main
+ with:
+ GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
+ GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
+ GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
+ GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
+ GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
+ GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
+ GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
+ GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
+ GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
+ secrets:
+ GERRIT_SSH_PRIVKEY: ${{ secrets.GERRIT_SSH_PRIVKEY }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..598e2e9
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,33 @@
+---
+name: PyPI release
+
+# yamllint disable-line rule:truthy
+on:
+ push:
+ # Only invoked on release tag pushes
+ tags:
+ - v*.*.*
+
+env:
+ python-version: 3.10
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ # yamllint disable-line rule:line-length
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+
+ - name: Configure Python
+ # yamllint disable-line rule:line-length
+ uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ with:
+ python-version: ${{ env.python-version }}
+
+ - name: Build package distribution files
+ uses: opencord/shared-workflows/.github/workflows/verify-unit-tests.yaml@main
+ with:
+ pypi-username: ${{ secrets.PYPI_USERNAME }}
+ pypi-password: ${{ secrets.PYPI_PASSWORD }}
+ prep-commands: "make python-protos"