-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update Makefile to be more modern
Added copywrite and golangci-lint steps to ci.yaml Added all ubuntu versions to test matrix Will make pass over the CRT build file in followup
- Loading branch information
Showing
11 changed files
with
323 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
schema_version = 1 | ||
|
||
project { | ||
license = "MPL-2.0" | ||
copyright_year = 2024 | ||
|
||
header_ignore = [ | ||
".golangci.yaml", | ||
".copywrite.hcl", | ||
".github/**", | ||
] | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Run CI Tests | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'README.md' | ||
push: | ||
branches: | ||
- 'main' | ||
paths-ignore: | ||
- 'README.md' | ||
jobs: | ||
run-lint: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-golang@v3 | ||
with: | ||
version-file: go.mod | ||
- uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: 1.59.1 | ||
skip-cache: true | ||
args: --timeout=9m | ||
run-copywrite: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/[email protected] | ||
- name: verify copywrite headers | ||
run: | | ||
copywrite --config .copywrite.hcl headers --spdx "MPL-2.0" --plan | ||
run-tests: | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- ubuntu-22.04 | ||
- ubuntu-24.04 | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-golang@v3 | ||
with: | ||
version-file: go.mod | ||
- name: Run Go Test | ||
run: | | ||
make test | ||
permissions: | ||
contents: read |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.21.3 | ||
1.22.4 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
SHELL = bash | ||
|
||
NOMAD_PLUGIN_DIR ?= /tmp/nomad-plugins | ||
|
||
.PHONY: clean | ||
clean: | ||
@echo "==> Cleanup previous build" | ||
rm -f $(NOMAD_PLUGIN_DIR)/nomad-device-nvidia | ||
|
||
.PHONY: copywrite | ||
copywrite: | ||
@echo "==> Checking copywrite headers" | ||
copywrite --config .copywrite.hcl headers --spdx "MPL-2.0" | ||
|
||
.PHONY: compile | ||
compile: clean | ||
@echo "==> Compile nvidia driver plugin ..." | ||
mkdir -p $(NOMAD_PLUGIN_DIR) | ||
go build -race -trimpath -o $(NOMAD_PLUGIN_DIR)/nomad-device-nvidia cmd/main.go | ||
|
||
.PHONY: test | ||
test: | ||
@echo "==> Running tests ..." | ||
go test -v -race ./... | ||
|
||
.PHONY: hack | ||
hack: compile | ||
hack: | ||
@echo "==> Run dev Nomad with nomad plugin" | ||
sudo nomad agent -dev -plugin-dir=$(NOMAD_PLUGIN_DIR) | ||
|
||
# CRT release compilation | ||
pkg/%/nomad-device-nvidia: GO_OUT ?= $@ | ||
pkg/%/nomad-device-nvidia: | ||
@echo "==> RELEASE BUILD of $@ ..." | ||
GOOS=linux GOARCH=$(lastword $(subst _, ,$*)) \ | ||
go build -trimpath -o $(GO_OUT) cmd/main.go | ||
|
||
# CRT release packaging (zip only) | ||
.PRECIOUS: pkg/%/nomad-device-nvidia | ||
pkg/%.zip: pkg/%/nomad-device-nvidia | ||
@echo "==> RELEASE PACKAGING of $@ ..." | ||
@cp LICENSE $(dir $<)LICENSE.txt | ||
zip -j $@ $(dir $<)* | ||
|
||
# CRT version generation | ||
.PHONY: version | ||
version: | ||
@$(CURDIR)/version/generate.sh version/version.go version/version.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.