Check node version
This commit is contained in:
parent
42a77a5cd5
commit
0e0a85df82
5 changed files with 20 additions and 12 deletions
8
.github/workflows/check.yml
vendored
8
.github/workflows/check.yml
vendored
|
|
@ -5,6 +5,7 @@ on:
|
|||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
|
@ -31,12 +32,5 @@ jobs:
|
|||
toolchain: "1.89.0"
|
||||
components: clippy, rustfmt
|
||||
|
||||
- name: Setup rust
|
||||
run: |
|
||||
which sqlx || cargo install sqlx-cli
|
||||
cd sync-server
|
||||
sqlx database create --database-url sqlite://db.sqlite3
|
||||
sqlx migrate run --source src/app_state/database/migrations --database-url sqlite://db.sqlite3
|
||||
|
||||
- name: Lint & test
|
||||
run: scripts/check.sh
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
set -e
|
||||
|
||||
./scripts/utils/check-node.sh
|
||||
|
||||
cd docs
|
||||
|
||||
npm ci
|
||||
|
|
|
|||
|
|
@ -8,8 +8,15 @@ if [[ "$1" == "--fix" ]]; then
|
|||
echo "Running in fix mode - will automatically fix linting and formatting issues"
|
||||
fi
|
||||
|
||||
./scripts/utils/check-node.sh
|
||||
|
||||
echo "Running checks in sync-server"
|
||||
|
||||
cd sync-server
|
||||
which sqlx || cargo install sqlx-cli
|
||||
sqlx database create --database-url sqlite://db.sqlite3
|
||||
sqlx migrate run --source src/app_state/database/migrations --database-url sqlite://db.sqlite3
|
||||
|
||||
cargo test --verbose
|
||||
|
||||
if [[ "$FIX_MODE" == true ]]; then
|
||||
|
|
|
|||
|
|
@ -6,11 +6,7 @@ set -o pipefail
|
|||
NO_COLOR=1
|
||||
FORCE_COLOR=0
|
||||
|
||||
node_version=$(node -v | sed 's/^v\([0-9]*\).*/\1/')
|
||||
if [ "$node_version" != "22" ]; then
|
||||
echo "Error: This script requires Node.js version 22, found: $node_version"
|
||||
exit 1
|
||||
fi
|
||||
./scripts/utils/check-node.sh
|
||||
|
||||
# Check if the argument is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
|
|
|
|||
9
scripts/utils/check-node.sh
Executable file
9
scripts/utils/check-node.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
node_version=$(node -v | sed 's/^v\([0-9]*\).*/\1/')
|
||||
if [ "$node_version" != "22" ]; then
|
||||
echo "Error: This script requires Node.js version 22, found: $node_version"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue