Skip to content

Commit

Permalink
Merge branch 'develop' into feature/viewer-1361-sidebar-und-header-an…
Browse files Browse the repository at this point in the history
…passen

# Conflicts:
#	ui/src/elements/ngm-side-bar.ts
#	ui/src/ngm-app.ts
  • Loading branch information
TIL-EBP committed Dec 9, 2024
2 parents fa22d34 + a83e607 commit e205457
Show file tree
Hide file tree
Showing 102 changed files with 7,183 additions and 7,034 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
package-lock.json -diff
* -text
1 change: 1 addition & 0 deletions .github/scripts/find-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const findNextVersion = (tags, branch) => {
if (version.preRelease == null || version.patch !== 0) {
version.minor += 1;
version.patch = 0;
version.preRelease = null
}
} else {
// It's a patch.
Expand Down
85 changes: 78 additions & 7 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
- "!main"

env:
NODE_VERSION: "22.x"
RUST_VERSION: "1.73"
NODE_VERSION: "22.5.1"
RUST_VERSION: "1.82"
SQLX_OFFLINE: true
SQLX_VERSION: 0.7.3
SQLX_VERSION: "0.8.2"
PGHOST: localhost # Overrides the default value in .env

jobs:
Expand All @@ -33,6 +33,16 @@ jobs:
uses: actions/checkout@v4
- name: Review Dependencies
uses: actions/dependency-review-action@v4
with:
# Disable scorecard output for now, as the output may get too large otherwise,
# causing the action to fail.
show-openssf-scorecard: false

# Allow GHSA-qg5g-gv98-5ffh (https://github.com/advisories/GHSA-qg5g-gv98-5ffh)
# Very recently found as of now (2024-11-26).
# Affects the Rust crate `rustls`, which is in use by multiple of our dependencies.
# There are no fixes for it yet.
allow-ghsas: GHSA-qg5g-gv98-5ffh


install-ui:
Expand Down Expand Up @@ -65,7 +75,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install node dependencies
run: cd ui && npm install
run: cd ui && npm ci


check-ui:
Expand Down Expand Up @@ -107,7 +117,9 @@ jobs:
path: ./ui/node_modules
key: "${{ runner.os }}-node_modules-${{ env.NODE_VERSION }}-${{ hashFiles('./ui/package-lock.json') }}"
- name: Run tests
run: cd ui && npm run test
run: |
cd ui
npm run test
lint-ui:
Expand All @@ -128,7 +140,33 @@ jobs:
path: ./ui/node_modules
key: "${{ runner.os }}-node_modules-${{ env.NODE_VERSION }}-${{ hashFiles('./ui/package-lock.json') }}"
- name: Run lint
run: cd ui && npm run lint
run: |
cd ui
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:
Expand Down Expand Up @@ -174,7 +212,6 @@ jobs:
- name: Setup SQLx
run: |
cd api
SQLX_VERSION=0.7.3
if [[ ! -f ~/.cargo/bin/sqlx ]] || [[ $(sqlx --version) != "sqlx-cli $SQLX_VERSION" ]]; then
cargo install sqlx-cli --version $SQLX_VERSION --no-default-features --features native-tls,postgres --locked --quiet
fi
Expand Down Expand Up @@ -318,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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/secrets.txt

# JetBrains IDE files
/.idea/
.idea/

# Local Docker volumes
/volumes/
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"javascript.preferences.quoteStyle": "single",
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"sonarlint.connectedMode.project": {
"connectionId": "swisstopo",
"projectKey": "swisstopo_swissgeol-viewer-app"
},
"makefile.configureOnOpen": false
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

### Added
- Add `PG_SSL_MODE` environment variable to allow SSL connections between the API and database.

### Changed
- Values for "Height", "Angle", "Pitch", and coordinates are now input fields. Users can adjust values using arrow keys.
Expand Down
4 changes: 3 additions & 1 deletion api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ PGPASSWORD=www-data
PGHOST=db
PGPORT=5432
PGDATABASE=swissgeol-local
PG_SSL_MODE=disable
# PG_SSL_MODE=require

# SQLx
DATABASE_URL=postgres://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}
DATABASE_URL=postgres://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}?ssl_mode=${PG_SSL_MODE}

# S3
S3_AWS_REGION=eu-west-1
Expand Down
Loading

0 comments on commit e205457

Please sign in to comment.