Skip to content

[WIP]chore: add supabase in github action #100

[WIP]chore: add supabase in github action

[WIP]chore: add supabase in github action #100

Workflow file for this run

name: PR Tests
on:
pull_request:
branches: [ "main" ]
paths:
- .github/workflows/**
- server/**
- petercat_utils/**
- subscriber/**
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
pull-requests: write
actions: write
env:
AWS_REGION: ${{ vars.AWS_REGION }}
REPORT_FILE: md_report.md
WEB_URL: http://127.0.0.1:3000
API_URL: http://127.0.0.1:8000
jobs:
build:
runs-on: ubuntu-latest
environment: Preview
services:
postgres:
image: supabase/postgres:latest
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
kong:
image: supabase/kong:latest
ports:
- 8000:8000
strategy:
fail-fast: true
defaults:
run:
working-directory: ./server
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::654654285942:role/Github-OIDC
audience: sts.amazonaws.com
aws-region: ${{ env.AWS_REGION }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.0'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff
pip install pytest pytest-cov
- name: Lint with Ruff
run: |
ruff check --output-format=github .
- name: Run Supabase CLI using Docker
env:
SUPABASE_DB_URL: postgres://postgres:postgres@localhost:5432/postgres
run: |
docker run --rm \
-e SUPABASE_ACCESS_TOKEN=${{ secrets.SUPABASE_ACCESS_TOKEN }} \
-e SUPABASE_URL=${{ secrets.SUPABASE_URL }} \
-e SUPABASE_DB_URL=${SUPABASE_DB_URL} \
-v $(pwd):/migrations \
supabase/cli \
supabase db push
- name: Run tests
run: pytest --cov
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}