name: CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  python:
    name: Python checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install dependencies
        run: pip install -r requirements.txt
      - name: Byte-compile server
        run: python -m compileall -q server.py
      - name: Validate example config is valid JSON
        run: python -c "import json; json.load(open('config.json.example'))"

  docker:
    name: Docker build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build image
        run: docker build -t ads-bit:ci .
