Skip to content

The admin key is long and scrolls off the right. This is easier to re… #2126

The admin key is long and scrolls off the right. This is easier to re…

The admin key is long and scrolls off the right. This is easier to re… #2126

name: Build and Test Convex Backend
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
jobs:
build_and_test:
name: Build and Test Convex Backend
runs-on: [self-hosted, aws, x64, xlarge]
services:
# Label used to access service container
postgres:
# Docker Hub image
image: bitnami/postgresql:13
# Provide the password for postgres
env:
POSTGRESQL_PASSWORD: postgres
POSTGRESQL_MAX_CONNECTIONS: 500
POSTGRESQL_REPLICATION_USE_PASSFILE: no
# Set health checks to wait until postgres has started
options: >-
--health-cmd "pg_isready -U postgres" --health-interval 10s
--health-timeout 5s --health-retries 5 --name postgres
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mysql:
# Docker Hub image
image: mysql:8.4.1-oracle@sha256:a7dc4a4e07a9c5d53c0cf36b5b4e8a1b3bb677cb0d544256a0581114a93ddf0f
# Provide the password for mysql
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
MYSQL_ROOT_PASSWORD: ""
# Set health checks to wait until mysql has started
options: >-
--health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
5s --health-retries 5
ports:
# Maps tcp port 3306 on service container to the host
- 3306:3306
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
r2-access-key: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
- name: Check Cargo.lock up-to-date
run: cargo update -w --locked
- name: Cache pnpm artifacts
uses: runs-on/cache@v4
env:
AWS_REGION: ${{ vars.AWS_REGION }}
RUNS_ON_S3_BUCKET_CACHE: ${{ vars.RUNS_ON_S3_BUCKET_CACHE }}
with:
path: |
npm-packages/common/temp/build-cache
npm-packages/common/temp/pnpm-store
key: pnpm-cache-${{
hashFiles('npm-packages/common/config/rush/pnpm-lock.yaml') }}-2
restore-keys: pnpm-cache-
- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: NPM install globals
run: npm ci --prefix scripts
- name: Install JS
run: |
just rush install
just rush build
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Build rust tests
run: cargo nextest run --no-run --profile ci
- name: Run Rust tests
env:
CI_PGUSER: postgres
CI_PGPASSWORD: postgres
run: DISABLE_FUZZY_TEXT_SEARCH=true cargo nextest run --profile ci