-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 17d0627
Showing
14 changed files
with
1,715 additions
and
0 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,29 @@ | ||
name: Lint and Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: [ v* ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: earthly/actions-setup@v1 | ||
with: | ||
version: v0.7.23 | ||
|
||
- name: Check Out Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Lint | ||
run: earthly +lint | ||
|
||
- name: Test | ||
run: earthly -P +test |
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,21 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Go workspace file | ||
go.work |
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,31 @@ | ||
VERSION 0.7 | ||
FROM golang:1.21-bookworm | ||
WORKDIR /workspace | ||
|
||
tidy: | ||
LOCALLY | ||
RUN go mod tidy | ||
RUN go fmt ./... | ||
|
||
lint: | ||
FROM golangci/golangci-lint:v1.55.2 | ||
WORKDIR /workspace | ||
COPY . ./ | ||
RUN golangci-lint run --timeout 5m ./... | ||
|
||
test: | ||
RUN apt update && apt install -y curl jq | ||
RUN curl -fsSL https://get.docker.com | bash | ||
COPY +modules/modules /lib/modules | ||
COPY go.* ./ | ||
RUN go mod download | ||
COPY . . | ||
WITH DOCKER --allow-privileged | ||
RUN --privileged mount -t devtmpfs devtmpfs /dev \ | ||
&& go test -coverprofile=coverage.out -v ./... | ||
END | ||
SAVE ARTIFACT ./coverage.out AS LOCAL coverage.out | ||
|
||
modules: | ||
LOCALLY | ||
SAVE ARTIFACT /lib/modules |
Oops, something went wrong.