chore(deps-dev): bump uuid from 10.0.0 to 11.0.2 #570
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JavaScript client tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
RUST_BACKTRACE: 1 | |
jobs: | |
test: | |
name: test | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
node-version: [20] | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: nittei | |
ports: | |
- 5432:5432 | |
env: | |
# Needed for sqlx | |
DATABASE_URL: postgresql://postgres:postgres@localhost/nittei | |
NITTEI__HTTP_PORT: 5000 | |
NITTEI__DATABASE_URL: postgresql://postgres:postgres@localhost/nittei | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
# Setup Rust as we need to run the server | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Start server | |
run: | | |
# run the migrations first | |
cargo install sqlx-cli --no-default-features --features postgres || true | |
(cd crates/infra && sqlx migrate run) | |
export RUST_LOG=error,tracing=info | |
cargo build | |
./target/debug/nittei &> output.log & | |
echo "Started server in background" | |
sleep 10 | |
- name: Install JS modules | |
run: | | |
cd clients/javascript | |
pnpm i | |
- name: Check if generated types are up-to-date | |
run: | | |
# Copy the generated types to a temporary folder for comparison | |
cd clients/javascript | |
cp -r ./lib/gen_types ./lib/gen_types_copy | |
cd ../.. | |
bash ./scripts/generate_ts_types.sh | |
# Compare the generated types with the copied ones | |
cd clients/javascript | |
diff -r ./lib/gen_types ./lib/gen_types_copy | |
# Get the exit code of the diff command | |
exit_code=$? | |
if [ $exit_code -ne 0 ]; then | |
echo "Generated types are not up-to-date" | |
echo "Generate them with 'just generate-ts-types' and commit the changes" | |
exit 1 | |
fi | |
# Remove the temporary folder | |
rm -rf ./lib/gen_types_copy | |
- name: Build JS | |
run: | | |
cd clients/javascript | |
pnpm run build | |
- name: Run tests | |
run: | | |
cd clients/javascript | |
pnpm run test | |
- name: Stop server | |
run: | | |
kill $(lsof -t -i:${NITTEI__HTTP_PORT}) || true | |
echo "Stopped server" |