-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (48 loc) · 1.54 KB
/
Copy pathgo.yml
File metadata and controls
56 lines (48 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master" ]
tags:
- v[0-9]+.[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+
pull_request:
branches: [ "master" ]
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build
run: go build -o ./k8s-device-plugin cmd/k8s-device-plugin/main.go
- name: Run tests
run: |
go test ./internal/pkg/api/... -v
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Docker Login
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: docker/login-action@v3.6.0
with:
username: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.DOCKERHUB_PASSWD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:master
- name: Build and optionally push
uses: docker/build-push-action@v6.18.0
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
tags: projecthami/mock-device-plugin:latest