dangeroustech/StreamDL

View on GitHub
.github/workflows/test.yml

Summary

Maintainability
Test Coverage
name: Pull Request Tests

on:
  pull_request:
    branches: [master, staging]

permissions:
  contents: read

jobs:
  Software_Tests:
    name: Software Tests
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: true
      matrix:
        python-version: ["3.12", "3.13"]
        go-version: [1.22, 1.23]
        os: [ubuntu-24.04, ubuntu-latest]
    steps:
      - uses: actions/checkout@v4
      - name: Install uv
        uses: astral-sh/setup-uv@v3
      - name: Set Up Python ${{ matrix.python-version }}
        run: uv python install ${{ matrix.python-version }}
      - uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.go-version }}
      - name: Install Deps
        run: |
          uv sync --all-extras --dev
      - name: Run Python Tests
        run: |
          uv run bandit -ll -c .bandit.yml streamdl_proto_srv.py
      - name: Run Go Tests
        env:
          STREAMDL_GRPC_PORT: "50051"
          STREAMDL_GRPC_ADDR: localhost
        run: |
          uv run python streamdl_proto_srv.py &
          go test -v -count=1 ./...
  Docker_Tests:
    name: Docker Build Test
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        component: [client, server]
    steps:
      - uses: actions/checkout@v4
      - name: Login to DockerHub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Docker Build and Push Unstable
        id: docker_build_push_unstable
        uses: docker/build-push-action@v5
        with:
          context: .
          file: Dockerfile.${{ matrix.component }}
          platforms: linux/amd64
          push: true
          tags: dangeroustech/streamdl:${{ matrix.component }}_unstable