chore: improve actions performance and security practices (#5970)
* chore: bump actions and pin versions * build: switch to blacksmith * fix: use rust-toolchain stable * build: improve pnpm store caching * chore: remove emoji from workflows * fix: run prepare job on blacksmith * chore: kebab case id * build: add concurrency groups to limit duplicate jobs * build: switch around node setup and pnpm setup task * chore: bump to nodejs 24, fix pnpm caching * fix: enable corepack * fix: concurrency deadlock in frontend preview * fix: approve build scripts * fix: just don't cancel concurrent previews * build: remove pnpm setup action everywhere * build: cache apt packages * build: yet another attempt at fixing concurrency * build: lower runner type for frontend deploy * fix: eslint not existing * build: add sccache to turbo-ci * fix: correct nextest pkg * fix: turbo ignoring sccache * revert me: test labrinth tests * Revert "revert me: test labrinth tests" This reverts commit def5cc19183d5c0fe3b6f3c03635d73bb59bd312. * build: compile app before docker build * build: lower runner types * build: remove docker inline caching * build: try mold on labrinth * build: tweak labrinth prod build profile * fix: app windows builds and caching * fix: tombi format cargo.toml * fix: swap ping test to cubecraft to avoid CI flakiness * typos fix --------- Co-authored-by: aecsocket <aecsocket@tutanota.com>
This commit is contained in:
@@ -1,22 +1,5 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM rust:1.90.0 AS build
|
||||
|
||||
WORKDIR /usr/src/labrinth
|
||||
COPY . .
|
||||
ARG GIT_HASH
|
||||
RUN --mount=type=cache,target=/usr/src/labrinth/target \
|
||||
--mount=type=cache,target=/usr/local/cargo,from=rust:1.89.0,source=/usr/local/cargo \
|
||||
SQLX_OFFLINE=true cargo build --profile release-labrinth --package labrinth
|
||||
|
||||
FROM build AS artifacts
|
||||
|
||||
RUN --mount=type=cache,target=/usr/src/labrinth/target \
|
||||
mkdir /labrinth \
|
||||
&& cp /usr/src/labrinth/target/release-labrinth/labrinth /labrinth/labrinth \
|
||||
&& cp -r /usr/src/labrinth/apps/labrinth/migrations /labrinth \
|
||||
&& cp -r /usr/src/labrinth/apps/labrinth/assets /labrinth
|
||||
|
||||
FROM debian:trixie-slim
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/modrinth/code
|
||||
@@ -28,7 +11,9 @@ RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates dumb-init curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=artifacts /labrinth /labrinth
|
||||
COPY labrinth /labrinth/labrinth
|
||||
COPY migrations /labrinth/migrations
|
||||
COPY assets /labrinth/assets
|
||||
|
||||
WORKDIR /labrinth
|
||||
ENTRYPOINT ["dumb-init", "--"]
|
||||
|
||||
@@ -355,12 +355,12 @@ mod tests {
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_ping_server_success() {
|
||||
let _status = ping_server("mc.hypixel.net", None).await.unwrap();
|
||||
let _status = ping_server("play.cubecraft.net", None).await.unwrap();
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_follow_srv_record() {
|
||||
_ = ping_server("hypixel.net", None).await.unwrap();
|
||||
_ = ping_server("cubecraft.net", None).await.unwrap();
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
@@ -370,7 +370,7 @@ mod tests {
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_ping_zero_timeout() {
|
||||
_ = ping_server("mc.hypixel.net", Some(Duration::ZERO))
|
||||
_ = ping_server("play.cubecraft.net", Some(Duration::ZERO))
|
||||
.await
|
||||
.unwrap_err();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user