cicd setup #1

Merged
silvana merged 1 commit from feat/cicd into main 2024-08-04 10:53:34 +00:00
12 changed files with 112 additions and 38 deletions
Showing only changes of commit e375c73ba8 - Show all commits

View file

@ -1,6 +1,3 @@
[target.x86_64-unknown-linux-gnu] [target.x86_64-unknown-linux-gnu]
linker = "clang" linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold", "-Zshare-generics=y"] 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

31
.woodpecker/html.yml Normal file
View file

@ -0,0 +1,31 @@
when:
- event: [tag]
steps:
cache-restore:
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 minio/yuno/cache-html/target target
failure: ignore
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}/
cache-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 target/ minio/yuno/cache-html/target
failure: ignore

39
.woodpecker/quality.yml Normal file
View file

@ -0,0 +1,39 @@
when:
- event: [pull_request]
steps:
cache-restore:
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 minio/yuno/cache-amd64/target target
failure: ignore
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
cache-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 target/ minio/yuno/cache-amd64/target
failure: ignore

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", "bevy_kira_audio",
"image", "image",
"log", "log",
"rand",
"webbrowser", "webbrowser",
"winit", "winit",
] ]

View file

@ -60,7 +60,6 @@ bevy = { version = "0.14", default-features = false, features = [
] } ] }
bevy_kira_audio = { version = "0.20" } bevy_kira_audio = { version = "0.20" }
bevy_asset_loader = { version = "0.21", features = ["2d"] } bevy_asset_loader = { version = "0.21", features = ["2d"] }
rand = { version = "0.8.3" }
webbrowser = { version = "1", features = ["hardened"] } webbrowser = { version = "1", features = ["hardened"] }
# keep the following in sync with Bevy's dependencies # 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 \ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output init-rust.sh \
&& chmod a+x init-rust.sh \ && chmod a+x init-rust.sh \
&& ./init-rust.sh -y \ && ./init-rust.sh -y \
&& /root/.cargo/bin/rustup target add wasm32-unknown-unknown \
&& /root/.cargo/bin/cargo install trunk && /root/.cargo/bin/cargo install trunk
ENV PATH="/root/.cargo/bin:$PATH" ENV PATH="/root/.cargo/bin:$PATH"

5
Trunk.toml Normal file
View file

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

View file

@ -12,11 +12,43 @@ body {
} }
.game-container { .game-container {
width: 100%;
height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: 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 { #bevy {
z-index: 2; z-index: 2;
} }

View file

@ -10,5 +10,9 @@
</head> </head>
<body> <body>
<link data-trunk rel="inline" href="html/sound.js" /> <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> </body>
</html> </html>