Add e2e tests to the CI
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -15,7 +15,7 @@ env:
|
|||||||
FORCE_COLOR: 1
|
FORCE_COLOR: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
unit-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: earthly/actions-setup@v1.0.8
|
- uses: earthly/actions-setup@v1.0.8
|
||||||
@@ -24,4 +24,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Build
|
- 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
|
||||||
|
14
Earthfile
14
Earthfile
@@ -13,7 +13,7 @@ build:
|
|||||||
|
|
||||||
SAVE ARTIFACT /build/enki enki AS LOCAL build/enki
|
SAVE ARTIFACT /build/enki enki AS LOCAL build/enki
|
||||||
|
|
||||||
test:
|
unit-test:
|
||||||
FROM golang:$GO_VERSION
|
FROM golang:$GO_VERSION
|
||||||
RUN apk add rsync gcc musl-dev docker jq
|
RUN apk add rsync gcc musl-dev docker jq
|
||||||
WORKDIR /build
|
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
|
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
|
END
|
||||||
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
|
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
|
||||||
|
Reference in New Issue
Block a user