Skip to content

Commit

Permalink
fix: flutter builder
Browse files Browse the repository at this point in the history
  • Loading branch information
bkioshn committed Jun 2, 2024
1 parent 404812d commit 862ff5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions catalyst_voices/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion catalyst_voices/test_driver/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 862ff5d

Please sign in to comment.