Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 79 additions & 19 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,98 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 🚨 CodeQL Analysis

on:
pull_request:
paths:
- "**.*"
workflow_call:
push:
branches:
- develop

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["go"]

include:
- language: actions
build-mode: none
- language: go
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
6 changes: 6 additions & 0 deletions .github/workflows/mkdocs-develop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: 📖 Deploy Dev Docs

on:
push:
paths:
- "docs/**"
- "mkdocs.yml"
branches:
- develop

jobs:
build-documents:
name: Test Documentation Build
Expand All @@ -17,6 +19,7 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
Expand All @@ -31,11 +34,14 @@ jobs:
path: .cache
restore-keys: |
mkdocs-material-

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r docs/build/requirements.txt

- name: Test Build
run: mkdocs build --verbose --strict

- name: Deploy Docs
run: mkdocs gh-deploy --force
54 changes: 54 additions & 0 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 🔍 PR Review

on:
pull_request:
paths:
- "**.*"
push:
branches:
- develop

permissions:
id-token: write
packages: write
contents: write
security-events: write
actions: read

jobs:
codeql:
name: 🚨 CodeQL Analysis
uses: ./.github/workflows/codeql.yml
secrets: inherit

test-build:
name: 🔨 Test Build
uses: ./.github/workflows/test-build.yml
secrets: inherit

test-docs:
name: 📙 Test docs
uses: ./.github/workflows/test-docs.yml
secrets: inherit

verify:
name: 🙏🏻 Verify
uses: ./.github/workflows/verify.yml
secrets: inherit

check:
name: ✅ Check
if: always()
needs:
- codeql
- test-build
- test-docs
- verify

runs-on: ubuntu-latest

steps:
- name: Require all jobs to succeed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 🎉 Publish

on:
push:
tags:
- "*" # Trigger on all tags

permissions:
id-token: write
packages: write
contents: write
security-events: write
actions: read

jobs:
release:
name: 🎉 Release
uses: ./.github/workflows/release.yml
secrets: inherit

publish:
name: 🎉 Publish
if: always()
needs: release

runs-on: ubuntu-latest

steps:
- name: Require all jobs to succeed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
name: 🎉 Release

on:
push:
tags:
- "*"
workflow_call:

jobs:
release:
name: Release
uses: ./.github/workflows/reusable-build.yml
with:
goreleaser_config: goreleaser.yml
goreleaser_options: ""
goreleaser_options: "--clean"
secrets: inherit
permissions:
id-token: write # For cosign
packages: write # For GHCR
contents: write # To upload archives as release assets

publish:
name: Publish PyPi
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4


permissions:
id-token: write # For cosign
packages: write # For GHCR
contents: write # To upload archives as release assets
33 changes: 11 additions & 22 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Reusable Build
name: ♻️ Reusable Build
on:
workflow_call:
inputs:
Expand All @@ -13,7 +13,7 @@ on:
type: string

env:
GO_VERSION: "1.22"
GO_VERSION: "1.24"

jobs:
prepare-linux:
Expand All @@ -36,12 +36,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to docker.io registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Checkout code
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -104,12 +98,6 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
if: matrix.os != 'macos-latest'

- name: Login to docker.io registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Checkout code
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -173,19 +161,19 @@ jobs:
- name: Install Syft
uses: anchore/sbom-action/[email protected]

- name: Login to docker.io registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to docker.io registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Checkout code
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -215,7 +203,7 @@ jobs:
mv artifacts/linux-dist/linux_arm64/build-linux_linux_arm64/* output/build-linux_arm64/
mv artifacts/linux-dist/linux_amd64/build-linux_linux_amd64_v1/* output/build-linux_amd64/
mv artifacts/windows-latest-dist/windows_amd64/build-windows_windows_amd64_v1/* output/build-windows_amd64/
mv artifacts/macos-latest-dist/darwin_arm64/build-macos_darwin_arm64/* output/build-darwin_arm64/
mv artifacts/macos-latest-dist/darwin_arm64/build-macos_darwin_arm64_v8.0/* output/build-darwin_arm64/
shell: bash

- name: View Output
Expand All @@ -227,7 +215,8 @@ jobs:
with:
distribution: goreleaser-pro
version: latest
args: release -f=.goreleaser/goreleaser-publish.yml ${{ inputs.goreleaser_options}}
args: release -f=.goreleaser/goreleaser-publish.yml ${{ inputs.goreleaser_options }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
COSIGN_EXPERIMENTAL: "true"
19 changes: 7 additions & 12 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: 🔨 Build Test
name: 🔨 Test Build

on:
pull_request:
paths:
- "**.*"
- "main.go"
- "go.mod"
- "Dockerfile"
push:
branches:
- develop
workflow_call:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Test Build
name: 🔨 Reusable Go Build
uses: ./.github/workflows/reusable-build.yml
with:
goreleaser_config: goreleaser.yml
goreleaser_options: "--snapshot"
goreleaser_options: "--clean --snapshot"
secrets: inherit
permissions:
id-token: write # For cosign
Expand Down
Loading
Loading