Skip to content

Commit

Permalink
CI updates
Browse files Browse the repository at this point in the history
- Install Ginkgo CLI using a step
- Add names to publish workflow steps
- Add names to PR workflow steps
- Update publish API workflow to use a supported output setting method
- Use a major floating tag for stale Actions
- Delete workflow to publish API reference in main

There isn't much value in publishing the API reference from main. Most
consumers of this information use release versions. Developers can
quickly access the API by deploying the CRDs and running 'kubectl
explain'
  • Loading branch information
Zerpet committed Aug 29, 2024
1 parent 7b7d802 commit 94695e1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 46 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout code

- uses: actions/setup-go@v5
name: Install Go
with:
go-version: 'stable'

- name: golangci-lint
- name: Run Golang Linter
uses: golangci/golangci-lint-action@v6
with:
version: latest
Expand All @@ -35,7 +37,7 @@ jobs:
name: Unit and Integration tests
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
- name: Check out code
uses: actions/checkout@v4

- name: Install Go
Expand Down Expand Up @@ -68,7 +70,7 @@ jobs:
outputs:
image_tag: ${{ steps.meta.outputs.version }}
steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
Expand Down Expand Up @@ -176,7 +178,7 @@ jobs:
tags: |
type=semver,pattern={{version}},suffix=-amd64,latest=false
- name: Build and push single-arch amd64 image
- name: Build and push single-arch AMD64 image
uses: docker/build-push-action@v6
with:
context: .
Expand Down Expand Up @@ -277,10 +279,11 @@ jobs:
id-token: 'write'
needs: build_operator
steps:
- name: Check out code into the Go module directory
- name: Check out code
uses: actions/checkout@v4

- uses: actions/setup-go@v5
name: Install Go
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
Expand Down Expand Up @@ -316,6 +319,9 @@ jobs:
only: ytt
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Ginkgo
uses: ci-tasks/setup-ginkgo@main

- name: Install cert-manager and cluster operator
run: |
make cert-manager cmctl cluster-operator
Expand All @@ -333,8 +339,7 @@ jobs:
- name: Notify Google Chat
# TODO: remove before PR
if: false
# if: failure()
if: failure()
uses: SimonScholz/google-chat-action@main
with:
webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}'
Expand All @@ -355,7 +360,7 @@ jobs:
with:
name: operator-manifests
- name: Release
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
uses: softprops/action-gh-release@v2
with:
files: |
messaging-topology-operator.yaml
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR
name: Build & Test PR

on:
pull_request:
Expand All @@ -19,12 +19,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout code

- uses: actions/setup-go@v5
name: Install Go
with:
go-version: 'stable'

- name: golangci-lint
- name: Run Golangci linter
uses: golangci/golangci-lint-action@v6
with:
version: latest
Expand All @@ -34,15 +36,15 @@ jobs:
name: Unit & Integration tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Unit tests
run: make install-tools kubebuilder-assets just-unit-tests

Expand All @@ -52,7 +54,7 @@ jobs:
build:
name: Build Operator image
runs-on: ubuntu-latest
needs: [unit_test]
needs: [unit_tests]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish-versioned-api-ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ jobs:
uses: actions/checkout@v4
with:
path: messaging-topology-operator

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo VERSION="${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Checkout wiki codebase
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki

- name: Push to wiki
run: |
cd wiki
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Close Stale Issues
uses: actions/stale@v9.0.0
uses: actions/stale@v9
with:
# Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`.
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/update-latest-api-ref.yml

This file was deleted.

0 comments on commit 94695e1

Please sign in to comment.