Fix(cicd): add html pipeline.
Some checks failed
ci/woodpecker/pr/quality Pipeline failed
ci/woodpecker/tag/html Pipeline was successful

This commit is contained in:
silvana 2024-08-04 10:17:17 +02:00
parent ff9950a89d
commit 63b189c0a8
Signed by: silvana
GPG key ID: 889CA3FB0F54CDCC
12 changed files with 84 additions and 41 deletions

View file

@ -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"

View file

@ -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

View file

@ -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

17
.woodpecker/html.yml Normal file
View file

@ -0,0 +1,17 @@
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
- rustup target add wasm32-unknown-unknown
- 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}/

25
.woodpecker/quality.yml Normal file
View file

@ -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

View file

@ -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

1
Cargo.lock generated
View file

@ -4517,7 +4517,6 @@ dependencies = [
"bevy_kira_audio",
"image",
"log",
"rand",
"webbrowser",
"winit",
]

View file

@ -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

View file

@ -7,6 +7,7 @@ WORKDIR /app
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output init-rust.sh \
&& chmod a+x init-rust.sh \
&& ./init-rust.sh -y \
&& /root/.cargo/bin/rustup target add wasm32-unknown-unknown \
&& /root/.cargo/bin/cargo install trunk
ENV PATH="/root/.cargo/bin:$PATH"

View file

@ -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;
}

View file

@ -10,5 +10,9 @@
</head>
<body>
<link data-trunk rel="inline" href="html/sound.js" />
<div class="game-container">
<div class="lds-dual-ring"></div>
<canvas id="bevy"> Javascript and support for canvas is required </canvas>
</div>
</body>
</html>

5
trunk.toml Normal file
View file

@ -0,0 +1,5 @@
[build]
public_url = "./"
[serve]
port = 8080