solorpower/.github/workflows/ci.yml
haneulai a716dbef96
Some checks are pending
CI / Crawler (Python ${{ matrix.python-version }}) (3.10) (push) Waiting to run
CI / Crawler (Python ${{ matrix.python-version }}) (3.11) (push) Waiting to run
CI / API (Python 3.11) (push) Waiting to run
CI / Database migration (push) Waiting to run
CI / App web build (Node 20) (push) Waiting to run
feat: harden solar monitoring through stage 7
2026-08-07 14:07:22 +09:00

98 lines
2.5 KiB
YAML

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
crawler:
name: Crawler (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
defaults:
run:
working-directory: crawler
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: crawler/requirements.txt
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements.txt
- run: python -m unittest discover -s tests -p 'test_*.py' -v
env:
PYTHONDONTWRITEBYTECODE: '1'
PYTHONIOENCODING: utf-8
api:
name: API (Python 3.11)
runs-on: ubuntu-latest
defaults:
run:
working-directory: api_server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: api_server/requirements.txt
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements.txt
- run: python -m unittest discover -s tests -p 'test_*.py' -v
env:
DEBUG: 'false'
PYTHONDONTWRITEBYTECODE: '1'
PYTHONIOENCODING: utf-8
SUPABASE_KEY: test-key
SUPABASE_URL: http://localhost:54321
database:
name: Database migration
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Run migration contract test
working-directory: supabase/tests
env:
PGPASSWORD: postgres
run: psql -h localhost -U postgres -d postgres -f stats_write_consistency_test.sql
app:
name: App web build (Node 20)
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: app/package-lock.json
- run: npm ci
- run: npm run test:ci
env:
CI: '1'