feat: support client api to wasm #591
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: AppFlowy-Cloud Integrations | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: [ main ] | |
env: | |
LOCALHOST_URL: http://localhost | |
LOCALHOST_WS: ws://localhost/ws | |
LOCALHOST_GOTRUE: http://localhost/gotrue | |
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres | |
SQLX_OFFLINE: true | |
jobs: | |
test: | |
name: Docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
AppFlowy-Cloud | |
- name: Copy and rename deploy.env to .env | |
run: cp deploy.env .env | |
- name: Replace values in .env | |
run: | | |
# log level | |
sed -i 's|RUST_LOG=.*|RUST_LOG=trace|' .env | |
sed -i 's/GOTRUE_SMTP_USER=.*/GOTRUE_SMTP_USER=${{ secrets.CI_GOTRUE_SMTP_USER }}/' .env | |
sed -i 's/GOTRUE_SMTP_PASS=.*/GOTRUE_SMTP_PASS=${{ secrets.CI_GOTRUE_SMTP_PASS }}/' .env | |
sed -i 's/GOTRUE_SMTP_ADMIN_EMAIL=.*/GOTRUE_SMTP_ADMIN_EMAIL=${{ secrets.CI_GOTRUE_SMTP_ADMIN_EMAIL }}/' .env | |
sed -i 's/GOTRUE_EXTERNAL_GOOGLE_ENABLED=.*/GOTRUE_EXTERNAL_GOOGLE_ENABLED=true/' .env | |
sed -i 's/GOTRUE_MAILER_AUTOCONFIRM=.*/GOTRUE_MAILER_AUTOCONFIRM=false/' .env | |
sed -i 's/API_EXTERNAL_URL=http:\/\/your-host/API_EXTERNAL_URL=http:\/\/localhost/' .env | |
sed -i 's/GOTRUE_RATE_LIMIT_EMAIL_SENT=100/GOTRUE_RATE_LIMIT_EMAIL_SENT=1000/' .env | |
# expose port for tests (postgres, minio) | |
sed -i '38s/$/\n ports:\n - 5432:5432/' docker-compose.yml | |
sed -i '26s/$/\n ports:\n - 9000:9000/' docker-compose.yml | |
- name: Update Nginx Configuration | |
run: | | |
# the wasm-pack headless tests will run on random ports, so we need to allow all origins | |
sed -i 's/http:\/\/127\.0\.0\.1:8000/http:\/\/127.0.0.1/g' nginx/nginx.conf | |
- name: Disable appflowyinc images | |
run: | | |
sed -i '/image: appflowyinc\/appflowy_cloud:/d' docker-compose.yml | |
sed -i '/image: appflowyinc\/admin_frontend:/d' docker-compose.yml | |
cat docker-compose.yml | |
- uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Run Docker-Compose | |
run: | | |
docker compose up -d | |
- name: Run tests | |
run: | | |
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Run WASM tests | |
working-directory: ./libs/wasm-test | |
run: | | |
cargo install wasm-pack | |
wasm-pack test --headless --firefox |