Skip to content

Adjust dp config and dp/frr container args/mounts #341

Adjust dp config and dp/frr container args/mounts

Adjust dp config and dp/frr container args/mounts #341

Workflow file for this run

name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- master
- release/*
tags:
- "v*"
paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
schedule:
- cron: "0 10 * * *" # ~2am PST
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
test:
runs-on: lab
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
- name: Setup Just
uses: extractions/setup-just@v3
- name: Lint and generate code
run: |
just --timestamp lint-gha gen _lint
- name: More Go lint
uses: golangci/golangci-lint-action@v6
with:
# keep in sync with hack/tools.just
version: v1.64.2
- name: Build everything
run: |
just --timestamp build kube-build
- name: Run tests
run: |
just --timestamp test
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
version: v0.27.0
cluster_name: kind
- name: Install CRDs into Kind
run: |
just --timestamp test-api
- name: Go mod tidy
run: |
go mod tidy
go mod vendor
# Don't remove it! We shouldn't allow CI to pass if there are any changes not committed after running gen/lint/test
- name: Fail on dirty
run: |
if ! git status --short || ! git diff --quiet; then
git --no-pager diff -- . :^vendor
echo "::error::Working directory is dirty. Please run 'just gen lint && go mod tidy && go mod vendor' and commit the changes."
exit 1
fi
- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
with:
limit-access-to-actor: true
publish-release:
runs-on: lab
if: startsWith(github.event.ref, 'refs/tags/v') && github.event_name == 'push'
needs:
- test
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Images, Helm charts and Bins on release
run: |
just --timestamp oci_repo=ghcr.io push
- name: Create GH Release
uses: softprops/action-gh-release@v2
with:
make_latest: true # TODO do it for master only
# TODO add files
# Bump gateway in the fabricator repository
- name: Checkout fabricator repository
uses: actions/checkout@v4
with:
repository: githedgehog/fabricator
path: fab-repo
persist-credentials: false
- name: Bump gateway in fabricator
working-directory: fab-repo
run: |
go get go.githedgehog.com/gateway@${{ github.ref_name }}
go mod tidy && go mod vendor && git add vendor
sed -i "s/^\tGatewayVersion.*/\tGatewayVersion=meta.Version(\"${{ github.ref_name }}\")/" pkg/fab/versions.go
go fmt pkg/fab/versions.go
- name: Generate token for the fabricator repository
uses: actions/create-github-app-token@v2
id: fab-app-token
with:
app-id: ${{ secrets.FAB_APP_ID }}
private-key: ${{ secrets.FAB_PRIVATE_KEY }}
repositories: |
fabricator
- name: Create Pull Request for fabricator
uses: peter-evans/create-pull-request@v7
id: fab-pr
with:
token: ${{ steps.fab-app-token.outputs.token }}
path: fab-repo
branch: pr/auto/gateway-bump
commit-message: |
bump: gateway to ${{ github.ref_name }}
This is an automated commit created by GitHub Actions workflow,
in the gateway repository.
signoff: true
title: "bump: gateway to ${{ github.ref_name }}"
body: |
This is an automated Pull Request created by GitHub Actions workflow,
in the gateway repository.
# Bump gateway in the fabric repository
- name: Checkout fabric repository
uses: actions/checkout@v4
with:
repository: githedgehog/fabric
path: fabric-repo
persist-credentials: false
- name: Bump gateway in fabric
working-directory: fabric-repo
run: |
go get go.githedgehog.com/gateway@${{ github.ref_name }}
go mod tidy && go mod vendor && git add vendor
- name: Generate token for the fabric repository
uses: actions/create-github-app-token@v2
id: fabric-app-token
with:
app-id: ${{ secrets.FABRIC_APP_ID }}
private-key: ${{ secrets.FABRIC_PRIVATE_KEY }}
repositories: |
fabric
- name: Create Pull Request for fabric
uses: peter-evans/create-pull-request@v7
id: fabric-pr
with:
token: ${{ steps.fabric-app-token.outputs.token }}
path: fabric-repo
branch: pr/auto/gateway-bump
commit-message: |
bump: gateway to ${{ github.ref_name }}
This is an automated commit created by GitHub Actions workflow,
in the gateway repository.
signoff: true
title: "bump: gateway to ${{ github.ref_name }}"
body: |
This is an automated Pull Request created by GitHub Actions workflow,
in the gateway repository.
# Bump gateway docs in the docs repository
- name: Checkout docs repository
uses: actions/checkout@v4
with:
repository: githedgehog/docs
path: docs-repo
persist-credentials: false
- name: Copy docs from gateway to docs
run: |
cp docs/api.md docs-repo/docs/reference/gateway-api.md.gen
- name: Generate token for the docs repository
uses: actions/create-github-app-token@v2
id: docs-app-token
with:
app-id: ${{ secrets.DOCS_APP_ID }}
private-key: ${{ secrets.DOCS_PRIVATE_KEY }}
repositories: |
docs
- name: Create Pull Request for docs
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.docs-app-token.outputs.token }}
path: docs-repo
branch: pr/auto/gateway-bump
commit-message: |
Update docs from gateway@${{ github.ref_name }}
This is an automated commit created by GitHub Actions workflow,
in the gateway repository.
signoff: true
title: "Update docs from gateway@${{ github.ref_name }}"
body: |
This is an automated Pull Request created by GitHub Actions workflow,
in the gateway repository.
It should be merged only after gateway in the fabricator repository
master branch updated to the ${{ github.ref_name }}: ${{ steps.fab-pr.outputs.pull-request-url }}.
- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
with:
limit-access-to-actor: true
publish-master:
runs-on: lab
if: github.event.ref == 'refs/heads/master' && github.event_name == 'push'
needs:
- test
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Images, Helm charts and Bins for master
run: |
just --timestamp oci_repo=ghcr.io version_extra=-master push
- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
with:
limit-access-to-actor: true