-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: mudler <[email protected]>
- Loading branch information
Showing
6 changed files
with
96 additions
and
5 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,16 @@ | ||
name: Lint | ||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run Lint | ||
run: | | ||
docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock --rm -t -v $(pwd):/workspace -v earthly-tmp:/tmp/earthly:rw earthly/earthly:v0.6.21 +lint |
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,20 @@ | ||
name: Unit tests | ||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run tests | ||
run: | | ||
docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock --rm -t -v $(pwd):/workspace -v earthly-tmp:/tmp/earthly:rw earthly/earthly:v0.6.21 --allow-privileged +test | ||
- name: Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
file: ./coverage.out |
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,23 @@ | ||
run: | ||
timeout: 5m | ||
tests: false | ||
linters: | ||
enable: | ||
- revive # replacement for golint | ||
- dupl # check duplicated code | ||
- goconst # check strings that can turn into constants | ||
- gofmt # check fmt | ||
- goheader # Check license headers, only checks files in current year | ||
- goimports # check imports | ||
- gocyclo # check complexity | ||
- govet | ||
- gosimple | ||
- deadcode | ||
- ineffassign | ||
- unused | ||
- varcheck | ||
- staticcheck | ||
- typecheck | ||
- structcheck | ||
- godot | ||
- misspell |
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,32 @@ | ||
VERSION 0.6 | ||
|
||
ARG GO_VERSION=1.18 | ||
ARG GOLINT_VERSION=1.47.3 | ||
|
||
go-deps: | ||
ARG GO_VERSION | ||
FROM golang:$GO_VERSION | ||
WORKDIR /build | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
RUN apt-get update | ||
SAVE ARTIFACT go.mod AS LOCAL go.mod | ||
SAVE ARTIFACT go.sum AS LOCAL go.sum | ||
|
||
test: | ||
FROM +go-deps | ||
ARG OPENAI_API_TOKEN | ||
WORKDIR /build | ||
RUN go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo | ||
COPY . . | ||
RUN ginkgo run --race --fail-fast --slow-spec-threshold 30s --covermode=atomic --coverprofile=coverage.out -p -r ./ | ||
SAVE ARTIFACT coverage.out AS LOCAL coverage.out | ||
|
||
lint: | ||
ARG GO_VERSION | ||
FROM golang:$GO_VERSION | ||
ARG GOLINT_VERSION | ||
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v$GOLINT_VERSION | ||
WORKDIR /build | ||
COPY . . | ||
RUN golangci-lint run |
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
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