Skip to content

Commit 7ccc7c2

Browse files
author
David Dornseifer
committed
Added GitHub Workflow
* Added GitHub workflow to run unit tests and build flow on pull requests
1 parent 2a34684 commit 7ccc7c2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: build
5+
6+
on: pull_request
7+
jobs:
8+
build:
9+
# this is to prevent the job to run at forked projects
10+
if: github.repository == 'aws/aws-nitro-enclaves-k8s-device-plugin'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Extract Go version
14+
run: |
15+
GO_VERSION=$(grep '^go' go.mod | awk '{print $2}')
16+
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go ${{ env.GO_VERSION }}
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: ${{ env.GO_VERSION }}
23+
- name: Build
24+
run: go build -v ./cmd/k8s-device-plugin/k8s-device-plugin.go
25+
- name: Test
26+
run: go test -v ./...

0 commit comments

Comments
 (0)