-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
150 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.git | ||
.idea | ||
|
||
.DS_Store | ||
|
||
web-cli/ui/node_modules | ||
ui/dist | ||
|
||
wasm/pkg |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: "Testing" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
steps: | ||
- uses: earthly/actions-setup@v1 | ||
with: | ||
version: v0.8.0 | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: run tests | ||
run: | | ||
earthly --ci +app-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
|
||
target | ||
core/target | ||
schema/target | ||
/schema/openapitools.json | ||
/Cargo.lock | ||
/schema/node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
VERSION 0.8 | ||
FROM scratch | ||
|
||
generate-cargo-chef-recipe: | ||
FROM lukemathwalker/cargo-chef:latest-rust-1.80-bookworm | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
SAVE ARTIFACT recipe.json AS LOCAL recipe.json | ||
|
||
base-build: | ||
FROM rust:1.80.1 | ||
|
||
# Install sccache (cargo is too slow) | ||
#RUN cargo install [email protected] | ||
ENV RUSTC_WRAPPER=sccache | ||
RUN wget https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \ | ||
&& tar xzf sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \ | ||
&& mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/local/bin/sccache \ | ||
&& chmod +x /usr/local/bin/sccache | ||
|
||
# Install cargo-chef | ||
RUN cargo install cargo-chef --locked | ||
|
||
#RUN cargo install wasm-pack slooooow | ||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
RUN rustup component add rustfmt | ||
|
||
# Cache dependencies with cargo chef | ||
COPY recipe.json . | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
RUN cd wasm && wasm-pack build | ||
|
||
wasm-build: | ||
BUILD +base-build | ||
FROM +base-build | ||
COPY . . | ||
|
||
WORKDIR /wasm | ||
RUN wasm-pack build --target web | ||
SAVE ARTIFACT pkg | ||
|
||
web-build: | ||
FROM node:22.7-bookworm | ||
|
||
ENV PROJECT_UI_DIR=web-cli/ui | ||
|
||
# Cache npm dependencies | ||
WORKDIR ${PROJECT_UI_DIR} | ||
COPY ${PROJECT_UI_DIR}/package.json . | ||
RUN npm install && npm install --dev | ||
|
||
COPY +wasm-build/pkg ./pkg | ||
|
||
WORKDIR / | ||
COPY . . | ||
|
||
RUN ls -la . | ||
|
||
WORKDIR ${PROJECT_UI_DIR} | ||
RUN npm run build | ||
SAVE IMAGE meta-secret-web:latest | ||
|
||
app-test: | ||
BUILD +base-build | ||
FROM +base-build | ||
COPY . . | ||
|
||
RUN cargo test --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.