diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5013d44..7e3fb87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/Earthfile b/Earthfile index 7c6612e..e8b6d11 100644 --- a/Earthfile +++ b/Earthfile @@ -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