Skip to content

Conversation

@danielendler
Copy link
Owner

Summary

  • add docker-compose.yml and env sample for Supabase
  • add E2E GitHub Actions workflow using Supabase docker stack

Testing

  • pytest tests/core -m "core and not slow" -q

https://chatgpt.com/codex/tasks/task_e_6842f77374a88325a8141919f187f9a0

Comment on lines 11 to 43
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev,all]
pip install pytest
- name: Start Supabase
run: |
cp docker/supabase/.env.example docker/supabase/.env
docker compose -f docker/supabase/docker-compose.yml up -d
- name: Wait for Supabase API
run: |
until curl -s http://localhost:8000/rest/v1/ | grep -q "Unauthorized"; do
echo 'Waiting for Supabase API...'
sleep 5
done
until pg_isready -h localhost -p 5432 -U postgres; do
echo 'Waiting for Supabase DB...'
sleep 5
done
- name: Run Full Test Suite
run: |
pytest tests/core tests/features tests/integration
- name: Shutdown Supabase
if: always()
run: |
docker compose -f docker/supabase/docker-compose.yml down

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 8 months ago

To fix the issue, we need to add a permissions block to the workflow. Since the workflow primarily interacts with repository contents (e.g., checking out code, caching files, and running tests), the minimal required permission is contents: read. This ensures that the GITHUB_TOKEN has only the necessary access to repository contents and no write permissions.

The permissions block should be added at the root level of the workflow file to apply to all jobs, as none of the jobs require additional permissions.

Suggested changeset 1
.github/workflows/supabase-e2e.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/supabase-e2e.yml b/.github/workflows/supabase-e2e.yml
--- a/.github/workflows/supabase-e2e.yml
+++ b/.github/workflows/supabase-e2e.yml
@@ -8,2 +8,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -8,2 +8,5 @@

permissions:
contents: read

jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
@codecov
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@danielendler danielendler deleted the codex/set-up-end-to-end-testing-with-supabase branch June 19, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants