Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dpeckett committed Feb 16, 2024
0 parents commit 17d0627
Show file tree
Hide file tree
Showing 14 changed files with 1,715 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
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
21 changes: 21 additions & 0 deletions .gitignore
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
31 changes: 31 additions & 0 deletions Earthfile
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
Loading

0 comments on commit 17d0627

Please sign in to comment.