From 22e90d71f0bfe97ad0c843294e042280bcd197e5 Mon Sep 17 00:00:00 2001 From: silvana Date: Sun, 4 Aug 2024 10:17:17 +0200 Subject: [PATCH] Fix(cicd): add html pipeline. --- .cargo/config.toml | 6 ------ .woodpecker/clippy.yml | 11 ----------- .woodpecker/fmt.yml | 11 ----------- .woodpecker/html.yml | 16 ++++++++++++++++ .woodpecker/quality.yml | 25 +++++++++++++++++++++++++ .woodpecker/test.yml | 11 ----------- Cargo.lock | 1 - Cargo.toml | 1 - html/styles.css | 32 ++++++++++++++++++++++++++++++++ index.html | 4 ++++ trunk.toml | 5 +++++ 11 files changed, 82 insertions(+), 41 deletions(-) delete mode 100644 .cargo/config.toml delete mode 100644 .woodpecker/clippy.yml delete mode 100644 .woodpecker/fmt.yml create mode 100644 .woodpecker/html.yml create mode 100644 .woodpecker/quality.yml delete mode 100644 .woodpecker/test.yml create mode 100644 trunk.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 5a2f738..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,6 +0,0 @@ -[target.x86_64-unknown-linux-gnu] -linker = "clang" -rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold", "-Zshare-generics=y"] - -[target.wasm32-unknown-unknown] -runner = "wasm-server-runner" diff --git a/.woodpecker/clippy.yml b/.woodpecker/clippy.yml deleted file mode 100644 index fc22646..0000000 --- a/.woodpecker/clippy.yml +++ /dev/null @@ -1,11 +0,0 @@ -when: - - event: [pull_request] - -steps: - clippy: - image: git.ragarock.moe/silvana/yuno/rust:latest - environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] - commands: - - rustup default nightly - - rustup component add clippy - - cargo clippy -- -D warnings diff --git a/.woodpecker/fmt.yml b/.woodpecker/fmt.yml deleted file mode 100644 index 0236183..0000000 --- a/.woodpecker/fmt.yml +++ /dev/null @@ -1,11 +0,0 @@ -when: - - event: [pull_request] - -steps: - fmt: - image: git.ragarock.moe/silvana/yuno/rust:latest - environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] - commands: - - rustup default nightly - - rustup component add rustfmt - - cargo fmt -- --check diff --git a/.woodpecker/html.yml b/.woodpecker/html.yml new file mode 100644 index 0000000..2645b1a --- /dev/null +++ b/.woodpecker/html.yml @@ -0,0 +1,16 @@ +when: + - event: [tag] + +steps: + build: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - trunk build + upload: + image: minio/mc + secrets: [access_key, secret_key] + commands: + - mc alias set minio https://minio.ragarock.moe $access_key $secret_key + - mc cp -quiet --recursive dist/ minio/yuno/${CI_COMMIT_TAG}/ diff --git a/.woodpecker/quality.yml b/.woodpecker/quality.yml new file mode 100644 index 0000000..723ff1f --- /dev/null +++ b/.woodpecker/quality.yml @@ -0,0 +1,25 @@ +when: + - event: [pull_request] + +steps: + fmt: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - rustup component add rustfmt + - cargo fmt -- --check + clippy: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - rustup component add clippy + - cargo clippy -- -D warnings + test: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - cargo check + - cargo test diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml deleted file mode 100644 index f3220ac..0000000 --- a/.woodpecker/test.yml +++ /dev/null @@ -1,11 +0,0 @@ -when: - - event: [pull_request] - -steps: - test: - image: git.ragarock.moe/silvana/yuno/rust:latest - environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] - commands: - - rustup default nightly - - cargo check - - cargo test diff --git a/Cargo.lock b/Cargo.lock index c23d5ab..1599035 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4517,7 +4517,6 @@ dependencies = [ "bevy_kira_audio", "image", "log", - "rand", "webbrowser", "winit", ] diff --git a/Cargo.toml b/Cargo.toml index a506d1a..6cbeaac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,6 @@ bevy = { version = "0.14", default-features = false, features = [ ] } bevy_kira_audio = { version = "0.20" } bevy_asset_loader = { version = "0.21", features = ["2d"] } -rand = { version = "0.8.3" } webbrowser = { version = "1", features = ["hardened"] } # keep the following in sync with Bevy's dependencies diff --git a/html/styles.css b/html/styles.css index 1b211ac..4160fde 100644 --- a/html/styles.css +++ b/html/styles.css @@ -12,11 +12,43 @@ body { } .game-container { + width: 100%; + height: 100%; display: flex; justify-content: center; align-items: center; } +.lds-dual-ring { + display: inline-block; + position: absolute; + left: 0; + right: 0; + margin: auto; + width: 80px; + height: 80px; +} + +.lds-dual-ring:after { + content: " "; + display: block; + width: 64px; + height: 64px; + border-radius: 50%; + border: 6px solid #fff; + border-color: #fff transparent #fff transparent; + animation: lds-dual-ring 1.2s linear infinite; +} + +@keyframes lds-dual-ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + #bevy { z-index: 2; } diff --git a/index.html b/index.html index 62406b5..8cbffd4 100644 --- a/index.html +++ b/index.html @@ -10,5 +10,9 @@ +
+
+ Javascript and support for canvas is required +
diff --git a/trunk.toml b/trunk.toml new file mode 100644 index 0000000..36598c5 --- /dev/null +++ b/trunk.toml @@ -0,0 +1,5 @@ +[build] +public_url = "./" + +[serve] +port = 8080