File tree Expand file tree Collapse file tree 6 files changed +28
-9
lines changed Expand file tree Collapse file tree 6 files changed +28
-9
lines changed Original file line number Diff line number Diff line change 99 golang_version :
1010 description : " The golang version for this project"
1111 value : ${{ jobs.variables.outputs.golang_version }}
12- pull_request :
13- types :
14- - opened
15- - synchronize
16- branches :
17- - main
18- - release-*
1912
2013jobs :
2114 variables :
2518 needs :
2619 - variables
2720 uses : ./.github/workflows/golang.yaml
21+ secrets : inherit
2822 with :
2923 golang_version : ${{ needs.variables.outputs.golang_version }}
3024
Original file line number Diff line number Diff line change 2323
2424jobs :
2525 basic :
26+ secrets : inherit
2627 uses : ./.github/workflows/basic-checks.yaml
2728
2829 image :
Original file line number Diff line number Diff line change @@ -54,12 +54,22 @@ jobs:
5454 - run : make test
5555 build :
5656 name : Build
57- runs-on : ubuntu-latest
57+ runs-on : linux-amd64-cpu4
58+ permissions :
59+ contents : read
60+ id-token : write
5861 steps :
5962 - name : Checkout code
6063 uses : actions/checkout@v5
6164 - name : Install Go
6265 uses : actions/setup-go@v6
6366 with :
6467 go-version : ${{ inputs.golang_version }}
65- - run : make build
68+
69+ - name : Setup Go Proxy
70+ id : setup-go-proxy
71+ uses : nv-gha-runners/setup-artifactory-go-proxy@main
72+ - env :
73+ GOPROXY : ${{ steps.setup-go-proxy.outputs.goproxy }}
74+ run : |
75+ make build
Original file line number Diff line number Diff line change 2727jobs :
2828 build :
2929 runs-on : linux-amd64-cpu4
30+ permissions :
31+ contents : read
32+ id-token : write
33+ packages : write
3034 steps :
3135 - uses : actions/checkout@v5
3236 name : Check out code
@@ -42,12 +46,16 @@ jobs:
4246 registry : ghcr.io
4347 username : ${{ github.actor }}
4448 password : ${{ secrets.GITHUB_TOKEN }}
49+ - name : Setup Go Proxy
50+ id : setup-go-proxy
51+ uses : nv-gha-runners/setup-artifactory-go-proxy@main
4552 - name : Build image
4653 env :
4754 IMAGE_NAME : ghcr.io/nvidia/k8s-device-plugin
4855 VERSION : ${{ inputs.version }}
4956 PUSH_ON_BUILD : true
5057 BUILD_MULTI_ARCH_IMAGES : ${{ inputs.build_multi_arch_images }}
58+ GOPROXY : ${{ steps.setup-go-proxy.outputs.goproxy }}
5159 run : |
5260 echo "${VERSION}"
5361 make -f deployments/container/Makefile build
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ FROM base AS devel
2020WORKDIR /work
2121COPY * .
2222
23+ ARG GOPROXY="https://proxy.golang.org,direct"
24+ ENV GOPROXY=$GOPROXY
25+
2326RUN make install-tools
2427
2528# We need to set the /work directory as a safe directory.
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ MKDIR ?= mkdir
2323# #### Global variables #####
2424include $(CURDIR ) /versions.mk
2525
26+ GOPROXY ?= https://proxy.golang.org,direct
27+
2628ifeq ($(IMAGE_NAME ) ,)
2729IMAGE_NAME := $(REGISTRY ) /$(DRIVER_NAME )
2830endif
@@ -78,6 +80,7 @@ $(IMAGE_TARGETS): image-%:
7880 --tag $(IMAGE ) \
7981 --build-arg VERSION=" $( VERSION) " \
8082 --build-arg GIT_COMMIT=" $( GIT_COMMIT) " \
83+ --build-arg GOPROXY=" $( GOPROXY) " \
8184 $(if $(LABEL_IMAGE_SOURCE ) ,--label "org.opencontainers.image.source=$(LABEL_IMAGE_SOURCE ) ",) \
8285 -f $(DOCKERFILE ) \
8386 $(CURDIR )
You can’t perform that action at this time.
0 commit comments