mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-09-25 06:24:19 +00:00
Remove earthly on tests (#699)
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
@@ -22,14 +22,9 @@ jobs:
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache-dependency-path: go.sum
|
||||
- name: Install earthly
|
||||
uses: Luet-lab/luet-install-action@v1
|
||||
with:
|
||||
repository: quay.io/kairos/packages
|
||||
packages: utils/earthly
|
||||
- name: Run tests
|
||||
run: |
|
||||
earthly +test
|
||||
go run github.com/onsi/ginkgo/v2/ginkgo --fail-fast --covermode=atomic --coverprofile=coverage.out -p -r ./internal
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
|
59
Earthfile
59
Earthfile
@@ -1,59 +0,0 @@
|
||||
VERSION 0.6
|
||||
|
||||
# renovate: datasource=docker depName=golang
|
||||
ARG GO_VERSION=1.23
|
||||
ARG TARGETARCH
|
||||
ARG CGO_ENABLED=0
|
||||
|
||||
go-deps:
|
||||
ARG GO_VERSION
|
||||
FROM golang:$GO_VERSION
|
||||
WORKDIR /build
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
SAVE ARTIFACT go.mod AS LOCAL go.mod
|
||||
SAVE ARTIFACT go.sum AS LOCAL go.sum
|
||||
|
||||
test:
|
||||
FROM +go-deps
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN go run github.com/onsi/ginkgo/v2/ginkgo --fail-fast --covermode=atomic --coverprofile=coverage.out -p -r ./internal
|
||||
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
|
||||
|
||||
BUILD_GOLANG:
|
||||
COMMAND
|
||||
WORKDIR /build
|
||||
COPY . ./
|
||||
ARG CGO_ENABLED
|
||||
ARG VERSION
|
||||
ARG LDFLAGS="-s -w -X 'github.com/kairos-io/provider-kairos/v2/internal/cli.VERSION=$VERSION'"
|
||||
ARG BIN
|
||||
ARG SRC
|
||||
ENV CGO_ENABLED=${CGO_ENABLED}
|
||||
RUN echo $LDFLAGS
|
||||
RUN go build -ldflags "${LDFLAGS}" -o ${BIN} ${SRC}
|
||||
SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN}
|
||||
|
||||
build-kairos-agent-provider:
|
||||
FROM +go-deps
|
||||
DO +BUILD_GOLANG --BIN=agent-provider-kairos --SRC=./ --CGO_ENABLED=$CGO_ENABLED
|
||||
|
||||
build-kairosctl:
|
||||
FROM +go-deps
|
||||
DO +BUILD_GOLANG --BIN=kairosctl --SRC=./cli/kairosctl --CGO_ENABLED=$CGO_ENABLED
|
||||
|
||||
build:
|
||||
BUILD +build-kairos-agent-provider
|
||||
BUILD +build-kairosctl
|
||||
|
||||
version:
|
||||
FROM alpine
|
||||
RUN apk add git
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN --no-cache echo $(git describe --always --tags --dirty) > VERSION
|
||||
|
||||
ARG VERSION=$(cat VERSION)
|
||||
SAVE ARTIFACT VERSION VERSION
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
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.8.15 --allow-privileged "$@"
|
Reference in New Issue
Block a user