chore: remove redundant sqlx command (#22)

* chore: remove redundant sqlx command

* chore: remove docker_env.sh

* chore: copy sqlx to docker

* chore update
This commit is contained in:
Nathan.fooo 2023-09-08 22:51:16 +08:00 committed by GitHub
parent 186ce6c5af
commit 7a09e1b860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 30 deletions

View File

@ -61,6 +61,4 @@ jobs:
- name: Run tests
run: |
cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
cargo sqlx database create
cargo sqlx migrate run
cargo test

View File

@ -33,8 +33,6 @@ jobs:
- name: Install Development Dependencies
run: |
cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
cargo sqlx database create
cargo sqlx migrate run
- name: Check sqlx-data.json
run: |
@ -44,4 +42,4 @@ jobs:
run: cargo fmt --check
- name: Clippy
run: SQLX_OFFLINE=true cargo clippy -- -D warnings
run: SQLX_OFFLINE=true cargo clippy -- -D warnings

View File

@ -1,18 +1,7 @@
ROOT = "./build"
SEMVER_VERSION=$(shell grep version Cargo.toml | awk -F"\"" '{print $$2}' | head -n 1)
.PHONY: prerequisite local_test
prerequisite:
POSTGRES_PORT=5432 ${ROOT}/init_database.sh
${ROOT}/init_redis.sh
appflowy_cloud_image:
source $(ROOT)/docker_env.sh && docker-compose up -d appflowy_cloud
local_test:
# 🔥 Must run init_database first
SQLX_OFFLINE=true cargo test
.PHONY: run test
run:
${ROOT}/run_local_server.sh

View File

@ -1,10 +0,0 @@
#!/bin/bash
export BACKEND_VERSION="v0.0.1"
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=password
export POSTGRES_PORT=5432
export POSTGRES_HOST=postgres
export POSTGRES_DB=appflowy
export DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}

View File

@ -16,6 +16,4 @@ until PGPASSWORD="${DB_PASSWORD}" psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_
>&2 echo "Postgres is still unavailable - sleeping"
sleep 1
done
sqlx database create
sqlx migrate run
cargo run

View File

@ -23,4 +23,4 @@ GOTRUE_REGISTERED_EMAIL=your_email@some_company.com
GOTRUE_REGISTERED_PASSWORD=your_password
# url to the postgres database
DATABASE_URL=postgres://postgres:password@localhost:5433/appflowy
DATABASE_URL=postgres://postgres:password@localhost:5433/postgres