Skip to content

Commit 1a29f38

Browse files
committed
Add
1 parent 0df0e6f commit 1a29f38

File tree

2 files changed

+54
-36
lines changed

2 files changed

+54
-36
lines changed

.github/workflows/code-quality.yml

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,41 +34,11 @@ jobs:
3434
uses: actions/dependency-review-action@v4
3535

3636

37-
check-changelog:
38-
name: "Check CHANGELOG"
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Checkout code
42-
uses: actions/checkout@v4
43-
with:
44-
# Fetch full history for comparison
45-
fetch-depth: 0
46-
- name: Determine if branch is a feature branch
47-
id: check_feature_branch
48-
run: |
49-
if [[ "${{ github.head_ref || github.ref_name }} " =~ ^feature/* ]]; then
50-
echo "is_feature=true" >> $GITHUB_ENV
51-
else
52-
echo "is_feature=false" >> $GITHUB_ENV
53-
fi
54-
- name: Check if CHANGELOG.md has changed
55-
if: env.is_feature == 'true'
56-
run: |
57-
# Compare the CHANGELOG.md file in the current branch with the `develop` branch
58-
if git diff --name-only origin/develop...HEAD | grep -q '^CHANGELOG.md$'; then
59-
echo "CHANGELOG.md has been updated."
60-
else
61-
echo "CHANGELOG.md has not been updated."
62-
exit 1
63-
fi
64-
65-
6637
install-ui:
6738
name: "Install UI"
6839
runs-on: ubuntu-latest
6940
needs:
7041
- dependency-review
71-
- check-changelog
7242
steps:
7343
- name: Checkout repository
7444
uses: actions/checkout@v4
@@ -165,7 +135,6 @@ jobs:
165135
runs-on: ubuntu-latest
166136
needs:
167137
- dependency-review
168-
- check-changelog
169138
steps:
170139
- name: Checkout repository
171140
uses: actions/checkout@v4
@@ -210,9 +179,6 @@ jobs:
210179
rm -r tests/
211180
echo "fn main() {}" > src/main.rs
212181
cargo build --all-targets --locked --quiet
213-
214-
rustup component add rustfmt
215-
rustup component add clippy
216182
217183
218184
check-api:
@@ -264,6 +230,7 @@ jobs:
264230
toolchain: ${{ env.RUST_VERSION }}
265231
profile: minimal
266232
override: true
233+
components: clippy, rustfmt
267234
- name: Restore cargo registry
268235
uses: actions/cache/restore@v4
269236
with:
@@ -286,7 +253,7 @@ jobs:
286253
- name: Run clippy
287254
run: |
288255
cd api
289-
cargo clippy --frozen
256+
cargo clippy --frozen --quiet
290257
291258
292259
test-api:
@@ -346,3 +313,54 @@ jobs:
346313
run: |
347314
kill $(cat api.pid)
348315
docker compose down
316+
317+
318+
check-changelog:
319+
name: "Check CHANGELOG"
320+
runs-on: ubuntu-latest
321+
steps:
322+
- name: Checkout code
323+
uses: actions/checkout@v4
324+
with:
325+
# Fetch full history for comparison
326+
fetch-depth: 0
327+
- name: Determine if branch is a feature branch
328+
id: check_feature_branch
329+
run: |
330+
if [[ "${{ github.head_ref || github.ref_name }} " =~ ^feature/* ]]; then
331+
echo "is_feature=true" >> $GITHUB_ENV
332+
else
333+
echo "is_feature=false" >> $GITHUB_ENV
334+
fi
335+
- name: Check if CHANGELOG.md has changed
336+
if: env.is_feature == 'true'
337+
continue-on-error: true
338+
run: |
339+
# Compare the CHANGELOG.md file in the current branch with the `develop` branch
340+
if git diff --name-only origin/develop...HEAD | grep -q '^CHANGELOG.md$'; then
341+
echo "CHANGELOG.md has been updated."
342+
else
343+
echo "::warning file=CHANGELOG.md::CHANGELOG.md has not been updated."
344+
exit 1
345+
exit 1
346+
fi
347+
348+
349+
prefer-single-commit:
350+
name: "Prefer Single Commit"
351+
runs-on: ubuntu-latest
352+
steps:
353+
- name: Checkout code
354+
uses: actions/checkout@v4
355+
with:
356+
# Fetch full history for comparison
357+
fetch-depth: 0
358+
- name: Count commits
359+
id: count_commits
360+
run: |
361+
commit_count=$(git rev-list --count HEAD ^origin/${{ github.event.pull_request.base.ref }})
362+
echo "commit_count=$commit_count" >> $GITHUB_ENV
363+
- name: Fail if more than one commit
364+
if: env.commit_count > 1
365+
run: |
366+
echo "::error title=Please Squash your PR::Pull request contains more than one commit ($commit_count commits). Please squash your commits."

ui/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM node:22-alpine as build
33
WORKDIR /app
44
COPY . .
55

6-
RUN npm install --no-scripts
6+
RUN npm install --ignore-scripts
77
RUN npm run build --omit=dev
88

99

0 commit comments

Comments
 (0)