Skip to content

Commit 4826d28

Browse files
committed
Ensure go version
1 parent 8edb603 commit 4826d28

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

.github/workflows/pull_request.yaml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v2
1414

15-
# - name: Lint
16-
# uses: golangci/golangci-lint-action@v2
17-
# with:
18-
# version: v1.32.2
19-
# args: --timeout=5m
15+
- name: Ensure Go Version
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: '^1.16'
19+
20+
- name: Lint
21+
uses: golangci/golangci-lint-action@v2
22+
with:
23+
version: v1.32.2
24+
args: --timeout=5m
2025

2126
- name: Ensure etcd
2227
id: Ensure-etcd
@@ -50,26 +55,26 @@ jobs:
5055
- name: Run tests
5156
run: make test
5257

53-
# - name: Figure out if running fork PR
54-
# id: fork
55-
# run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"'
58+
- name: Figure out if running fork PR
59+
id: fork
60+
run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"'
5661

57-
# - name: Docker Login
58-
# uses: docker/login-action@v1
59-
# with:
60-
# registry: ${{ secrets.DOCKER_REGISTRY }}
61-
# username: ${{ secrets.DOCKER_REGISTRY_USER }}
62-
# password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
63-
# if: steps.fork.outputs.is_fork_pr == 'false'
62+
- name: Docker Login
63+
uses: docker/login-action@v1
64+
with:
65+
registry: ${{ secrets.DOCKER_REGISTRY }}
66+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
67+
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
68+
if: steps.fork.outputs.is_fork_pr == 'false'
6469

65-
# - name: Build Docker image
66-
# run: |
67-
# export DOCKER_TAG=pr-${GITHUB_HEAD_REF}
68-
# make docker-build
70+
- name: Build Docker image
71+
run: |
72+
export DOCKER_TAG=pr-${GITHUB_HEAD_REF}
73+
make docker-build
6974
70-
# - name: Push Docker image
71-
# run: |
72-
# # pull request images are prefixed with 'pr' to prevent them from overriding released images
73-
# export DOCKER_TAG=pr-${GITHUB_HEAD_REF}
74-
# make docker-push
75-
# if: steps.fork.outputs.is_fork_pr == 'false'
75+
- name: Push Docker image
76+
run: |
77+
# pull request images are prefixed with 'pr' to prevent them from overriding released images
78+
export DOCKER_TAG=pr-${GITHUB_HEAD_REF}
79+
make docker-push
80+
if: steps.fork.outputs.is_fork_pr == 'false'

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ crd-cwnp-for-testing:
186186

187187
KUBEBUILDER_VERSION:=2.3.2
188188
kubebuilder:
189-
echo $(wildcard ~/.kubebuilder/${KUBEBUILDER_VERSION})
190189
ifeq (,$(wildcard ~/.kubebuilder/${KUBEBUILDER_VERSION}))
191190
{ \
192191
os=$$(go env GOOS) ;\
@@ -198,4 +197,4 @@ ifeq (,$(wildcard ~/.kubebuilder/${KUBEBUILDER_VERSION}))
198197
endif
199198

200199
kubebuilder-version-ci:
201-
@echo ${KUBEBUILDER_VERSION}
200+
@echo ${KUBEBUILDER_VERSION}

0 commit comments

Comments
 (0)