ci: add a git.json metadata file during build
Some checks failed
🚀 Lint & Test & Deploy / release (push) Failing after 3m14s
Some checks failed
🚀 Lint & Test & Deploy / release (push) Failing after 3m14s
This commit is contained in:
@@ -13,16 +13,12 @@
|
|||||||
"markdown": {},
|
"markdown": {},
|
||||||
"toml": {},
|
"toml": {},
|
||||||
"dockerfile": {},
|
"dockerfile": {},
|
||||||
"ruff": {},
|
|
||||||
"jupyter": {},
|
|
||||||
"malva": {},
|
|
||||||
"markup": {
|
"markup": {
|
||||||
// https://dprint.dev/plugins/markup_fmt/config/
|
// https://dprint.dev/plugins/markup_fmt/config/
|
||||||
"scriptIndent": true,
|
"scriptIndent": true,
|
||||||
"styleIndent": true,
|
"styleIndent": true,
|
||||||
},
|
},
|
||||||
"yaml": {},
|
"yaml": {},
|
||||||
"graphql": {},
|
|
||||||
"exec": {
|
"exec": {
|
||||||
"cwd": "${configDir}",
|
"cwd": "${configDir}",
|
||||||
"commands": [
|
"commands": [
|
||||||
@@ -53,13 +49,8 @@
|
|||||||
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
|
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
|
||||||
"https://plugins.dprint.dev/toml-0.7.0.wasm",
|
"https://plugins.dprint.dev/toml-0.7.0.wasm",
|
||||||
"https://plugins.dprint.dev/dockerfile-0.3.3.wasm",
|
"https://plugins.dprint.dev/dockerfile-0.3.3.wasm",
|
||||||
"https://plugins.dprint.dev/ruff-0.6.11.wasm",
|
|
||||||
"https://plugins.dprint.dev/jupyter-0.2.1.wasm",
|
|
||||||
"https://plugins.dprint.dev/g-plane/malva-v0.15.1.wasm",
|
|
||||||
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.25.3.wasm",
|
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.25.3.wasm",
|
||||||
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
|
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
|
||||||
"https://plugins.dprint.dev/g-plane/pretty_graphql-v0.2.3.wasm",
|
|
||||||
"https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364",
|
"https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364",
|
||||||
"https://plugins.dprint.dev/biome-0.11.10.wasm",
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
28
.gitea/scripts/build.sh
Executable file
28
.gitea/scripts/build.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
mkdir -p app/static
|
||||||
|
|
||||||
|
cp CHANGELOG.md app/static/CHANGELOG.md
|
||||||
|
|
||||||
|
cat >app/static/git.json <<EOF
|
||||||
|
{
|
||||||
|
"ref": "${GITEA_REF:-}",
|
||||||
|
"ref_name": "${GITEA_REF_NAME:-}",
|
||||||
|
"ref_type": "${GITEA_REF_TYPE:-}",
|
||||||
|
"sha": "${GITEA_SHA:-}",
|
||||||
|
"run_number": "${GITEA_RUN_NUMBER:-}",
|
||||||
|
"server_url": "${GITEA_SERVER_URL:-}",
|
||||||
|
"event_name": "${GITEA_EVENT_NAME:-}",
|
||||||
|
"workflow": "${GITEA_WORKFLOW:-}",
|
||||||
|
"job": "${GITEA_JOB:-}",
|
||||||
|
"commit_message": "${GITEA_COMMIT_MESSAGE:-}",
|
||||||
|
"commit_timestamp": "${GITEA_COMMIT_TIMESTAMP:-}",
|
||||||
|
"branch": "${GITEA_HEAD_REF:-}",
|
||||||
|
"base_branch": "${GITEA_BASE_REF:-}"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
cp -R packages/ui/build app/build/ui
|
||||||
16
.gitea/scripts/ci-checks.sh
Executable file
16
.gitea/scripts/ci-checks.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
pnpm lint &
|
||||||
|
LINT_PID=$!
|
||||||
|
pnpm format:check &
|
||||||
|
FORMAT_PID=$!
|
||||||
|
pnpm check &
|
||||||
|
TYPE_PID=$!
|
||||||
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" pnpm test &
|
||||||
|
TEST_PID=$!
|
||||||
|
|
||||||
|
wait $LINT_PID
|
||||||
|
wait $FORMAT_PID
|
||||||
|
wait $TYPE_PID
|
||||||
|
wait $TEST_PID
|
||||||
@@ -46,20 +46,11 @@ jobs:
|
|||||||
- name: 📦 Install Dependencies
|
- name: 📦 Install Dependencies
|
||||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||||
|
|
||||||
- name: 🧹 Lint
|
- name: 🧹 Quality Control
|
||||||
run: pnpm lint
|
run: ./.gitea/scripts/ci-checks.sh
|
||||||
|
|
||||||
- name: 🎨 Format Check
|
|
||||||
run: pnpm format:check
|
|
||||||
|
|
||||||
- name: 🧬 Type Check
|
|
||||||
run: pnpm check
|
|
||||||
|
|
||||||
- name: 🛠️ Build
|
- name: 🛠️ Build
|
||||||
run: pnpm build:deploy
|
run: ./.gitea/scripts/build.sh
|
||||||
|
|
||||||
- name: 🔬 Tests
|
|
||||||
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" pnpm test
|
|
||||||
|
|
||||||
- name: 🚀 Create Release Commit
|
- name: 🚀 Create Release Commit
|
||||||
if: gitea.ref_type == 'tag'
|
if: gitea.ref_type == 'tag'
|
||||||
|
|||||||
40
Dockerfile
40
Dockerfile
@@ -1,28 +1,28 @@
|
|||||||
FROM node:25-bookworm-slim
|
FROM node:25-bookworm-slim
|
||||||
|
|
||||||
RUN apt update && apt install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
git \
|
git \
|
||||||
jq \
|
jq \
|
||||||
g++ \
|
g++ \
|
||||||
make \
|
make \
|
||||||
rclone \
|
rclone \
|
||||||
libglapi-mesa \
|
libglapi-mesa \
|
||||||
libosmesa6 \
|
libosmesa6 \
|
||||||
xvfb
|
xvfb
|
||||||
|
|
||||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||||
CARGO_HOME=/usr/local/cargo \
|
CARGO_HOME=/usr/local/cargo \
|
||||||
PATH=/usr/local/cargo/bin:$PATH
|
PATH=/usr/local/cargo/bin:$PATH
|
||||||
|
|
||||||
RUN curl --silent --show-error --location --fail --retry 3 \
|
RUN curl --silent --show-error --location --fail --retry 3 \
|
||||||
--proto '=https' --tlsv1.2 \
|
--proto '=https' --tlsv1.2 \
|
||||||
--output /tmp/rustup-init.sh https://sh.rustup.rs \
|
--output /tmp/rustup-init.sh https://sh.rustup.rs \
|
||||||
&& sh /tmp/rustup-init.sh -y --no-modify-path --profile minimal \
|
&& sh /tmp/rustup-init.sh -y --no-modify-path --profile minimal \
|
||||||
&& rm /tmp/rustup-init.sh \
|
&& rm /tmp/rustup-init.sh \
|
||||||
&& rustup target add wasm32-unknown-unknown \
|
&& rustup target add wasm32-unknown-unknown \
|
||||||
&& rm -rf /usr/local/rustup/toolchains/*/share/doc \
|
&& rm -rf /usr/local/rustup/toolchains/*/share/doc \
|
||||||
&& npm i -g pnpm \
|
&& npm i -g pnpm \
|
||||||
&& pnpx playwright install-deps \
|
&& pnpx playwright install-deps \
|
||||||
&& pnpx playwright install --with-deps firefox \
|
&& pnpx playwright install --with-deps firefox \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
@@ -2,16 +2,14 @@
|
|||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "pnpm run -r --filter 'ui' build",
|
"postinstall": "pnpm run -r --filter 'ui' build",
|
||||||
"build": "pnpm build:nodes && pnpm build:app",
|
|
||||||
"lint": "pnpm run -r --parallel lint",
|
"lint": "pnpm run -r --parallel lint",
|
||||||
"format": "pnpm dprint fmt",
|
"format": "pnpm dprint fmt",
|
||||||
"format:check": "pnpm dprint check",
|
"format:check": "pnpm dprint check",
|
||||||
"test": "pnpm run -r test",
|
"test": "pnpm run -r test",
|
||||||
"check": "pnpm run -r check",
|
"check": "pnpm run -r check",
|
||||||
"build:story": "pnpm -r --filter 'ui' story:build",
|
"build": "pnpm build:nodes && pnpm build:app",
|
||||||
"build:app": "BASE_PATH=/ui pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build",
|
"build:app": "BASE_PATH=/ui pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build",
|
||||||
"build:nodes": "cargo build --workspace --target wasm32-unknown-unknown --release && rm -rf ./app/static/nodes/max/plantarium/ && mkdir -p ./app/static/nodes/max/plantarium/ && cp -R ./target/wasm32-unknown-unknown/release/*.wasm ./app/static/nodes/max/plantarium/",
|
"build:nodes": "cargo build --workspace --target wasm32-unknown-unknown --release && rm -rf ./app/static/nodes/max/plantarium/ && mkdir -p ./app/static/nodes/max/plantarium/ && cp -R ./target/wasm32-unknown-unknown/release/*.wasm ./app/static/nodes/max/plantarium/",
|
||||||
"build:deploy": "cp CHANGELOG.md app/static/CHANGELOG.md && pnpm build && cp -R packages/ui/build app/build/ui",
|
|
||||||
"dev:nodes": "chokidar './nodes/**' --initial -i '/pkg/' -c 'pnpm build:nodes'",
|
"dev:nodes": "chokidar './nodes/**' --initial -i '/pkg/' -c 'pnpm build:nodes'",
|
||||||
"dev:app_ui": "pnpm -r --parallel --filter 'app' --filter './packages/ui' dev",
|
"dev:app_ui": "pnpm -r --parallel --filter 'app' --filter './packages/ui' dev",
|
||||||
"dev_ui": "pnpm -r --filter 'ui' dev:ui",
|
"dev_ui": "pnpm -r --filter 'ui' dev:ui",
|
||||||
|
|||||||
Reference in New Issue
Block a user