Compare commits
2 Commits
0624795370
...
69a4d5a084
| Author | SHA1 | Date | |
|---|---|---|---|
| 69a4d5a084 | |||
| e13a81e31e |
@@ -65,18 +65,20 @@ jobs:
|
||||
api-unit:
|
||||
name: API Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/astral-sh/uv:python3.12-bookworm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
- name: Install Node (for JS actions)
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends nodejs ca-certificates curl
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Cache uv store
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/uv
|
||||
path: /root/.cache/uv
|
||||
key: uv-${{ hashFiles('api/uv.lock') }}
|
||||
restore-keys: uv-
|
||||
|
||||
@@ -102,18 +104,25 @@ jobs:
|
||||
api-lint:
|
||||
name: API Lint
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/astral-sh/uv:python3.12-bookworm
|
||||
steps:
|
||||
- name: Install Node (for JS actions)
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends nodejs ca-certificates curl
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run Ruff
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
~/.local/bin/uvx ruff check .
|
||||
run: uvx ruff check .
|
||||
working-directory: api
|
||||
|
||||
api-integration:
|
||||
name: API Integration Tests
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/astral-sh/uv:python3.12-bookworm
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
@@ -126,33 +135,37 @@ jobs:
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 10
|
||||
minio:
|
||||
image: quay.io/minio/minio
|
||||
env:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadmin
|
||||
options: >-
|
||||
--entrypoint sh
|
||||
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 10
|
||||
cmd: ["-c", "minio server /data"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Start MinIO
|
||||
- name: Install Node and curl (for JS actions and mc)
|
||||
run: |
|
||||
docker run -d --name ci-minio \
|
||||
--network container:$(hostname) \
|
||||
-e MINIO_ROOT_USER=minioadmin \
|
||||
-e MINIO_ROOT_PASSWORD=minioadmin \
|
||||
quay.io/minio/minio server /data
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends nodejs ca-certificates curl
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Create MinIO bucket
|
||||
run: |
|
||||
curl -fsSL https://dl.min.io/client/mc/release/linux-amd64/mc -o /tmp/mc
|
||||
chmod +x /tmp/mc
|
||||
until /tmp/mc alias set local http://localhost:9000 minioadmin minioadmin; do sleep 2; done
|
||||
/tmp/mc mb local/reactbin-test
|
||||
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
until /tmp/mc alias set local http://minio:9000 minioadmin minioadmin; do sleep 2; done
|
||||
/tmp/mc mb local/reactbin-test --ignore-existing
|
||||
|
||||
- name: Cache uv store
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/uv
|
||||
path: /root/.cache/uv
|
||||
key: uv-${{ hashFiles('api/uv.lock') }}
|
||||
restore-keys: uv-
|
||||
|
||||
@@ -166,7 +179,7 @@ jobs:
|
||||
env:
|
||||
TEST_DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@postgres/reactbin_test
|
||||
DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@postgres/reactbin_test
|
||||
S3_ENDPOINT_URL: http://localhost:9000
|
||||
S3_ENDPOINT_URL: http://minio:9000
|
||||
S3_BUCKET_NAME: reactbin-test
|
||||
S3_ACCESS_KEY_ID: minioadmin
|
||||
S3_SECRET_ACCESS_KEY: minioadmin
|
||||
@@ -176,10 +189,6 @@ jobs:
|
||||
OWNER_USERNAME: testowner
|
||||
OWNER_PASSWORD: testpass
|
||||
|
||||
- name: Stop MinIO
|
||||
if: always()
|
||||
run: docker stop ci-minio || true && docker rm ci-minio || true
|
||||
|
||||
# ── Image builds (tag-only, gated on all jobs) ────────────────────────────────
|
||||
|
||||
build-api:
|
||||
@@ -230,4 +239,4 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/reactbin-ui:${{ github.ref_name }}
|
||||
${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/reactbin-ui:latest
|
||||
${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/reactbin-ui:latest
|
||||
Reference in New Issue
Block a user