fix(web): add lazy loading for images #310
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: API Unit/e2e Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
files-changed: | |
name: Files Changed check | |
runs-on: ubuntu-latest | |
outputs: | |
api: ${{ steps.changes.outputs.api }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
api: | |
- 'api/**' | |
api: | |
needs: files-changed | |
if: ${{ needs.files-changed.outputs.api == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: 'postgresql://cinesync-dev:@BarelyAnInconvenience@@localhost:5432/cinesync-dev' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
cache: npm | |
cache-dependency-path: api/package.json | |
- uses: docker/setup-buildx-action@v1 | |
- name: Instantiate a Postgres db for e2e testing | |
run: docker compose up --build -d db | |
- name: Wait for Postgres become fully ready | |
run: npx --silent wait-on -t 10000 tcp:5432 | |
- name: Apply database migrations and generate a prisma client | |
run: cd api && npm run db:migrate && npm run db:generate | |
- name: Run tests | |
env: | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
MAILGUN_DOMAIN: ${{ secrets.MAILGUN_DOMAIN }} | |
MAILGUN_KEY: ${{ secrets.MAILGUN_KEY }} | |
run: | | |
cd api | |
npm install | |
npm run test | |
npm run test:e2e |