diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index bf41d8aef..3ab908fbb 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -145,6 +145,30 @@ jobs: npm run lint + build-ui: + name: "Build UI" + runs-on: ubuntu-latest + needs: + - test-ui + - lint-ui + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Restore cached node modules + uses: actions/cache/restore@v4 + with: + path: ./ui/node_modules + key: "${{ runner.os }}-node_modules-${{ env.NODE_VERSION }}-${{ hashFiles('./ui/package-lock.json') }}" + - name: Build + run: | + cd ui + npm run build + + install-api: name: "Install API" runs-on: ubuntu-latest @@ -331,6 +355,40 @@ jobs: docker compose down + build-api: + name: "Build API" + runs-on: ubuntu-latest + needs: + - test-api + - lint-api + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_VERSION }} + components: clippy, rustfmt + - name: Restore cargo registry + uses: actions/cache/restore@v4 + with: + path: ~/.cargo/registry + key: "${{ runner.os }}-cargo_registry-${{ env.RUST_VERSION }}-${{ hashFiles('./api/Cargo.lock') }}" + - name: Restore cargo index + uses: actions/cache/restore@v4 + with: + path: ~/.cargo/git + key: "${{ runner.os }}-cargo_index-${{ env.RUST_VERSION }}-${{ hashFiles('./api/Cargo.lock') }}" + - name: Restore cargo build + uses: actions/cache/restore@v4 + with: + path: ./api/target + key: "${{ runner.os }}-cargo_build-${{ env.RUST_VERSION }}-${{ hashFiles('/api/Cargo.lock') }}" + - name: Build + run: | + cd api + cargo build + check-changelog: name: "Check CHANGELOG" runs-on: ubuntu-latest diff --git a/api/Dockerfile b/api/Dockerfile index 7fe160f24..a1541cc73 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,5 +1,8 @@ FROM rust:1.82 AS build +ARG APP_VERSION +ENV APP_VERSION=${APP_VERSION} + RUN apt update && apt install -y musl-tools musl-dev RUN rustup target add x86_64-unknown-linux-musl @@ -13,6 +16,9 @@ RUN cargo build --target x86_64-unknown-linux-musl --release --quiet FROM alpine:3.17 +ARG APP_VERSION +ENV APP_VERSION=${APP_VERSION} + RUN apk add --no-cache util-linux ## Import from builder. diff --git a/ui/Dockerfile b/ui/Dockerfile index a62fd2fa9..308323667 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -1,5 +1,8 @@ FROM node:22.5.1-alpine AS build +ARG APP_VERSION +ENV APP_VERSION=${APP_VERSION} + WORKDIR /app COPY . .