Skip to content

feat(share): Reduce school trial period to 14 days #4490

feat(share): Reduce school trial period to 14 days

feat(share): Reduce school trial period to 14 days #4490

name: Api - Backend - PR
on:
pull_request:
paths:
- '.github/workflows/backend-api-pr.yml'
- 'shared/**'
- 'backend/ji_core/**'
- 'backend/api/**'
push:
branches:
- master
- sandbox
paths:
- 'shared/**'
- 'backend/ji_core/**'
- 'backend/api/**'
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all --manifest-path backend/api/Cargo.toml --check
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
backend/api/target
key: ${{ runner.os }}-check-${{ hashFiles('backend/api/Cargo.lock') }}
- run: cargo check --manifest-path backend/api/Cargo.toml --no-default-features
# work in progress: currently yarn doesn't work right
test:
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--tmpfs /var/lib/postgresql/data
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
backend/api/target
key: ${{ runner.os }}-test-backend-rs-${{ hashFiles('backend/api/Cargo.lock') }}
- run: cargo test --manifest-path backend/api/Cargo.toml --no-default-features
env:
DATABASE_URL: postgres://postgres:password@localhost
SQLX_OFFLINE: 1