Skip to content

Commit a59b08d

Browse files
committed
add testing github action, rename pushing action
1 parent f0a0a80 commit a59b08d

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test and build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
pull_request:
9+
branches:
10+
- master
11+
12+
13+
permissions: write-all
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.19'
22+
23+
- uses: actions/[email protected]
24+
25+
- name: Test With Coverage
26+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
27+
- name: Upload coverage to Codecov
28+
uses: codecov/[email protected]
29+
with:
30+
files: coverage.txt
31+
32+
- name: golangci-lint
33+
uses: golangci/[email protected]
34+
with:
35+
args: --timeout=5m
36+
# since go test already does it in a previous step
37+
skip-pkg-cache: true
38+
39+
build-image:
40+
runs-on: ubuntu-latest
41+
needs: test
42+
steps:
43+
-
44+
name: Set up QEMU
45+
uses: docker/setup-qemu-action@v3
46+
-
47+
name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
-
50+
name: Build and push
51+
uses: docker/build-push-action@v5
52+
with:
53+
# Only for CI testing purposes
54+
push: false
55+
tags: wfs/k8s-image-availability-exporter:latest

.github/workflows/push_image.yml renamed to .github/workflows/push-image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-and-push-base-image (release)
1+
name: Build and push image
22

33
on:
44

@@ -25,4 +25,4 @@ jobs:
2525
context: "."
2626
dockerfile: ./Dockerfile
2727
image_name: ${{ github.repository }}
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)