diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1371303d..23f57786 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -36,16 +36,4 @@ jobs: cargo run config-e2e.yml --color never & cd .. - scripts/update-api-types.sh - cd frontend - npm ci - npm run build - npm run lint - if [[ $(git status --porcelain) ]]; then - git status --porcelain - echo "Failing CI because the working directory is not clean after updating the API types" - exit 1 - fi - - cd .. scripts/e2e.sh 32 diff --git a/scripts/check.sh b/scripts/check.sh new file mode 100755 index 00000000..750831ed --- /dev/null +++ b/scripts/check.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -e + +echo "Running checks in sync-server" +cd sync-server +cargo clippy --all-targets --all-features +cargo fmt --all -- --check +cargo machete +cargo test --verbose + +scripts/update-api-types.sh + +echo "Running checks in frontend" +cd ../frontend +npm ci +npm run build +npm run lint +npm run test + +if [[ $(git status --porcelain) ]]; then + git status --porcelain + echo "Failing CI because the working directory is not clean after linting" + exit 1 +fi + +echo "Success" + +cd .. diff --git a/scripts/e2e.sh b/scripts/e2e.sh index 149d76f9..55cb1ac8 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -15,6 +15,7 @@ process_count=$1 mkdir -p logs cd frontend +npm ci npm run build ../scripts/utils/wait-for-server.sh @@ -33,7 +34,7 @@ print_failed_log() { # Get the exit code of the process wait ${pids[$i-1]} exit_code=$? - + # Only consider non-zero exit codes as failures if [ $exit_code -ne 0 ]; then cat "$(pwd)/logs/log_${i}.log"