Add e2e tests to the CI

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis
2023-10-05 17:53:15 +03:00
parent 76fdd9cfda
commit 96ffaa652c
2 changed files with 25 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ env:
FORCE_COLOR: 1
jobs:
test:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@v1.0.8
@@ -24,4 +24,14 @@ jobs:
with:
fetch-depth: 0
- name: Build
run: earthly -P +test
run: earthly -P +unit-test
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@v1.0.8
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build
run: earthly -P +e2e-test

View File

@@ -13,7 +13,7 @@ build:
SAVE ARTIFACT /build/enki enki AS LOCAL build/enki
test:
unit-test:
FROM golang:$GO_VERSION
RUN apk add rsync gcc musl-dev docker jq
WORKDIR /build
@@ -27,3 +27,15 @@ test:
RUN go run github.com/onsi/ginkgo/v2/ginkgo run --label-filter "$LABEL_FILTER" -v --fail-fast --race --covermode=atomic --coverprofile=coverage.out --coverpkg=github.com/kairos-io/enki/... -p -r $TEST_PATHS
END
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
e2e-test:
FROM golang:$GO_VERSION
RUN apk add rsync gcc musl-dev docker jq
WORKDIR /build
COPY . .
RUN go mod download
# Some test require the docker sock exposed
WITH DOCKER
RUN go run github.com/onsi/ginkgo/v2/ginkgo run -v --fail-fast --race --covermode=atomic --coverprofile=coverage.out --coverpkg=github.com/kairos-io/enki/... -p -r e2e
END
SAVE ARTIFACT coverage.out AS LOCAL coverage.out