Skip to content

Commit 2353712

Browse files
authored
Merge pull request #19 from llm-d/move-to-gha-remove-tekton
Move to gha remove tekton
2 parents f9554c2 + 50eda26 commit 2353712

26 files changed

+190
-1499
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Docker Build - ghcr
2+
description: Build image using buildx
3+
inputs:
4+
image-name:
5+
required: true
6+
description: Image name
7+
tag:
8+
required: true
9+
description: Image tag
10+
github-token:
11+
required: true
12+
description: GitHub token for login
13+
registry:
14+
required: true
15+
description: Container registry (e.g., ghcr.io/llm-d)
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Login to GitHub Container Registry
23+
run: echo "${{ inputs.github-token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
24+
shell: bash
25+
26+
- name: Print image info
27+
run: |
28+
echo "Image name: ${{ inputs.image-name }}"
29+
echo "Tag: ${{ inputs.tag }}"
30+
echo "Registry: ${{ inputs.registry }}"
31+
shell: bash
32+
33+
- name: Build image
34+
run: |
35+
docker buildx build \
36+
--platform linux/amd64 \
37+
-t ${{ inputs.registry }}/${{ inputs.image-name }}:${{ inputs.tag }} \
38+
--push .
39+
shell: bash
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
apiVersion: tekton.dev/v1
2-
kind: Task
3-
metadata:
4-
name: go-test-task
5-
spec:
6-
workspaces:
7-
- name: source
1+
name: Go Test
2+
description: Run Ginkgo tests
3+
runs:
4+
using: "composite"
85
steps:
9-
- name: install-deps
10-
image: quay.io/projectquay/golang:1.24
11-
imagePullPolicy: IfNotPresent
12-
script: |
13-
#!/bin/bash
6+
- run: |
147
echo "Installing Ginkgo..."
158
go install github.com/onsi/ginkgo/ginkgo@latest
169
export PATH=$PATH:$(go env GOPATH)/bin
1710
echo "Ginkgo installed:"
1811
ginkgo version
19-
cd $(workspaces.source.path)
2012
echo "Running tests with Ginkgo..."
2113
go env -w GOFLAGS=-buildvcs=false
2214
make test
15+
shell: bash

.github/actions/push-image/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Push Docker Image
2+
description: Push built image to container registry
3+
inputs:
4+
image-name:
5+
required: true
6+
tag:
7+
required: true
8+
registry:
9+
required: true
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Push image
14+
run: |
15+
docker push ${{ inputs.registry }}/${{ inputs.image-name }}:${{ inputs.tag }}
16+
shell: bash

.github/actions/trivy-scan/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Trivy Scan
2+
description: Scan container image with Trivy
3+
inputs:
4+
image:
5+
required: true
6+
runs:
7+
using: "composite"
8+
steps:
9+
- name: Install Trivy
10+
run: |
11+
wget https://github.com/aquasecurity/trivy/releases/download/v0.44.1/trivy_0.44.1_Linux-64bit.deb
12+
sudo dpkg -i trivy_0.44.1_Linux-64bit.deb
13+
shell: bash
14+
15+
16+
- name: Scan image
17+
run: |
18+
trivy image --severity HIGH,CRITICAL --no-progress ${{ inputs.image }}
19+
shell: bash

.github/workflows/ci-pr-checks.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI - PR Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint-and-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout source
13+
uses: actions/checkout@v4
14+
15+
- name: Sanity check repo contents
16+
run: ls -la
17+
18+
- name: Set up go with cache
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.24.0'
22+
cache-dependency-path: ./go.sum
23+
24+
- name: Run lint checks
25+
uses: golangci/golangci-lint-action@v8
26+
with:
27+
version: 'v2.1.6'
28+
args: "--config=./.golangci.yml"
29+
30+
- name: Run go test
31+
shell: bash
32+
run: |
33+
make test

.github/workflows/ci-release.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI - Release - Docker Container Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Runs when a tag like v0.1.0 is pushed
7+
release:
8+
types: [published] # Also runs when a GitHub release is published
9+
10+
jobs:
11+
docker-build-and-push:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v4
16+
17+
- name: Set project name from repository
18+
id: version
19+
run: |
20+
repo="${GITHUB_REPOSITORY##*/}"
21+
echo "project_name=$repo" >> "$GITHUB_OUTPUT"
22+
23+
- name: Print project name
24+
run: echo "Project is ${{ steps.version.outputs.project_name }}"
25+
26+
- name: Determine tag name
27+
id: tag
28+
run: |
29+
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
30+
echo "tag=${GITHUB_REF##refs/tags/}" >> "$GITHUB_OUTPUT"
31+
elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
32+
echo "tag=${GITHUB_REF##refs/tags/}" >> "$GITHUB_OUTPUT"
33+
else
34+
echo "tag=latest" >> "$GITHUB_OUTPUT"
35+
fi
36+
shell: bash
37+
38+
- name: Build and push image
39+
uses: ./.github/actions/docker-build-and-push
40+
with:
41+
tag: ${{ steps.tag.outputs.tag }}
42+
image-name: ${{ steps.version.outputs.project_name }}
43+
registry: ghcr.io/llm-d
44+
github-token: ${{ secrets.GHCR_TOKEN }}
45+
46+
- name: Run Trivy scan
47+
uses: ./.github/actions/trivy-scan
48+
with:
49+
image: ghcr.io/llm-d/${{ steps.version.outputs.project_name }}:${{ steps.tag.outputs.tag }}

.golangci.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
# Refer to golangci-lint's example config file for more options and information:
2-
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
31
version: "2"
42

53
run:
64
timeout: 5m
7-
modules-download-mode: readonly
5+
allow-parallel-runners: true
86

9-
linters:
7+
formatters:
108
enable:
11-
- errcheck
12-
- govet
13-
- staticcheck
9+
- goimports
10+
- gofmt
1411

15-
issues:
16-
exclude-use-default: false
17-
max-issues-per-linter: 0
18-
max-same-issues: 0
12+
linters:
13+
enable:
14+
- copyloopvar
15+
- dupword
16+
- durationcheck
17+
- fatcontext
18+
- ginkgolinter
19+
- gocritic
20+
- govet
21+
- loggercheck
22+
- misspell
23+
- perfsprint
24+
- revive
25+
- unconvert
26+
- makezero
27+
- errcheck
28+
- goconst
29+
- ineffassign
30+
- nakedret
31+
- prealloc
32+
- unparam
33+
- unused

.tekton/README.md

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)