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
8 changes: 1 addition & 7 deletions .github/workflows/basic-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ on:
golang_version:
description: "The golang version for this project"
value: ${{ jobs.variables.outputs.golang_version }}
pull_request:
types:
- opened
- synchronize
branches:
- main
- release-*

jobs:
variables:
Expand All @@ -25,6 +18,7 @@ jobs:
needs:
- variables
uses: ./.github/workflows/golang.yaml
secrets: inherit
with:
golang_version: ${{ needs.variables.outputs.golang_version }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:

jobs:
basic:
secrets: inherit
uses: ./.github/workflows/basic-checks.yaml

image:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,22 @@ jobs:
- run: make test
build:
name: Build
runs-on: ubuntu-latest
runs-on: linux-amd64-cpu4
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.golang_version }}
- run: make build

- name: Setup Go Proxy
id: setup-go-proxy
uses: nv-gha-runners/setup-artifactory-go-proxy@main
- env:
GOPROXY: ${{ steps.setup-go-proxy.outputs.goproxy }}
run: |
make build
8 changes: 8 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
jobs:
build:
runs-on: linux-amd64-cpu4
permissions:
contents: read
id-token: write
packages: write
steps:
- uses: actions/checkout@v5
name: Check out code
Expand All @@ -42,12 +46,16 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go Proxy
id: setup-go-proxy
uses: nv-gha-runners/setup-artifactory-go-proxy@main
- name: Build image
env:
IMAGE_NAME: ghcr.io/nvidia/k8s-device-plugin
VERSION: ${{ inputs.version }}
PUSH_ON_BUILD: true
BUILD_MULTI_ARCH_IMAGES: ${{ inputs.build_multi_arch_images }}
GOPROXY: ${{ steps.setup-go-proxy.outputs.goproxy }}
run: |
echo "${VERSION}"
make -f deployments/container/Makefile build
3 changes: 3 additions & 0 deletions deployments/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ FROM base AS devel
WORKDIR /work
COPY * .

ARG GOPROXY="https://proxy.golang.org,direct"
ENV GOPROXY=$GOPROXY

RUN make install-tools

# We need to set the /work directory as a safe directory.
Expand Down
3 changes: 3 additions & 0 deletions deployments/container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ MKDIR ?= mkdir
##### Global variables #####
include $(CURDIR)/versions.mk

GOPROXY ?= https://proxy.golang.org,direct

ifeq ($(IMAGE_NAME),)
IMAGE_NAME := $(REGISTRY)/$(DRIVER_NAME)
endif
Expand Down Expand Up @@ -78,6 +80,7 @@ $(IMAGE_TARGETS): image-%:
--tag $(IMAGE) \
--build-arg VERSION="$(VERSION)" \
--build-arg GIT_COMMIT="$(GIT_COMMIT)" \
--build-arg GOPROXY="$(GOPROXY)" \
$(if $(LABEL_IMAGE_SOURCE),--label "org.opencontainers.image.source=$(LABEL_IMAGE_SOURCE)",) \
-f $(DOCKERFILE) \
$(CURDIR)
Expand Down