Skip to content

Commit

Permalink
Merge pull request #1399 from swisstopo/fix/failing-ui-build
Browse files Browse the repository at this point in the history
Fix: Failing UI Build
  • Loading branch information
daniel-va authored Nov 27, 2024
2 parents 88a5c94 + a07e1b3 commit 25c0a66
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM node:22.5.1-alpine AS build

ARG APP_VERSION
ENV APP_VERSION=${APP_VERSION}

WORKDIR /app
COPY . .

Expand Down

0 comments on commit 25c0a66

Please sign in to comment.