diff --git a/catalyst_voices/Earthfile b/catalyst_voices/Earthfile index 4ef247149b..65a4ebad1c 100644 --- a/catalyst_voices/Earthfile +++ b/catalyst_voices/Earthfile @@ -3,7 +3,8 @@ VERSION 0.8 IMPORT ../catalyst-gateway AS catalyst-gateway IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:fix/flutter-builder-ci AS flutter-ci -src: +# builder - Copy all the necessary files and running bootstrap +builder: DO flutter-ci+SETUP COPY ../+repo-catalyst-voices-all/repo . DO flutter-ci+BOOTSTRAP @@ -19,8 +20,8 @@ code-generator: LET gen_code_path = lib/generated/catalyst_gateway LET local_gen_code_path = packages/catalyst_voices_services/lib/generated/catalyst_gateway/ - FROM +src - WORKDIR /frontend/catalyst_voices/packages/catalyst_voices_services + FROM +builder + WORKDIR catalyst_voices/packages/catalyst_voices_services COPY catalyst-gateway+build/doc/cat-gateway-api.json openapi/cat-gateway-api.json DO flutter-ci+OPENAPI_CODE_GEN \ --SAVE_LOCALLY=$save_locally \ @@ -37,29 +38,32 @@ check-flutter-code-generator: # Check diff between local code and earthly artifacts RUN diff /tmp/repo_generated lib/generated/catalyst_gateway +# check-static-analysis - Runs static analysis on the code check-static-analysis: - FROM +src + FROM +builder DO flutter-ci+ANALYZE +# check-code-formatting - Runs code formatting checks check-code-formatting: - FROM +src + FROM +builder DO flutter-ci+FORMAT -# Build web version of Catalyst Voices -build: - FROM +src +# build-web - Build web version of Catalyst Voices +build-web: + FROM +builder ARG WORKDIR=/frontend/catalyst_voices DO flutter-ci+BUILD_WEB --TARGET=lib/configs/main_web.dart --WORKDIR=$WORKDIR SAVE ARTIFACT web +# test-unit - Run unit tests test-unit: - FROM +src + FROM +builder DO flutter-ci+UNIT_TESTS package: FROM nginx:alpine3.18 ARG tag='latest' - COPY +build/web web + COPY +build-web/web web COPY ./nginx.conf /etc/nginx/nginx.conf EXPOSE 80 diff --git a/catalyst_voices/test_driver/Earthfile b/catalyst_voices/test_driver/Earthfile index a35db067f1..61f6656df5 100644 --- a/catalyst_voices/test_driver/Earthfile +++ b/catalyst_voices/test_driver/Earthfile @@ -3,7 +3,7 @@ VERSION 0.8 IMPORT ../ AS catalyst-voices integration-test-web: - FROM catalyst-voices+build + FROM catalyst-voices+build-web ARG TARGETARCH ARG browser LET driver_port = 4444