| #<!-- |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| #--> |
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| |
| name: Build Burr |
| |
| on: |
| push: |
| branches: |
| - main # Triggers the workflow on push events to the main branch |
| pull_request: |
| # Triggers the workflow on pull request events for any branch |
| types: [opened, synchronize, reopened] |
| |
| jobs: |
| pre-commit: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: actions/setup-python@v4 |
| with: |
| python-version: '3.12' |
| - name: Cache pre-commit environments |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/pre-commit |
| key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} |
| - name: Install pre-commit |
| run: pip install pre-commit |
| - name: Run pre-commit hooks |
| run: pre-commit run --all-files |
| |
| test: |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ['3.9', '3.10', '3.11', '3.12'] |
| |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - name: Set up Python ${{ matrix.python-version }} |
| uses: actions/setup-python@v4 |
| with: |
| python-version: ${{ matrix.python-version }} |
| |
| - name: Install Graphviz system dependency |
| run: | |
| sudo apt-get install -y --no-install-recommends graphviz |
| sudo apt-get clean |
| |
| - name: Install dependencies |
| run: | |
| python -m pip install -e ".[tests,tracking-client,graphviz]" |
| |
| - name: Run tests |
| run: | |
| python -m pytest tests --ignore=tests/integrations/persisters |
| |
| validate-examples: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: actions/setup-python@v4 |
| with: |
| python-version: '3.12' |
| - name: Install dependencies |
| run: | |
| python -m pip install -e ".[tests]" |
| - name: Validate examples |
| working-directory: ./examples |
| run: | |
| python -m pytest validate_examples.py |
| |
| test-persister-dbs: |
| runs-on: ubuntu-latest |
| services: |
| mongodb: |
| image: mongo:7.0 |
| ports: |
| - 27017:27017 |
| postgres: |
| image: postgres:15 |
| env: |
| POSTGRES_PASSWORD: postgres |
| ports: |
| - 5432:5432 |
| redis: |
| image: redis:7 |
| ports: |
| - 6379:6379 |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ['3.9', '3.10', '3.11', '3.12'] |
| |
| steps: |
| - uses: actions/checkout@v4 |
| - name: Set up Python ${{ matrix.python-version }} |
| uses: actions/setup-python@v4 |
| with: |
| python-version: ${{ matrix.python-version }} |
| - name: Install dependencies |
| run: | |
| python -m pip install -e ".[tests,tracking-client]" |
| - name: Run tests |
| run: | |
| BURR_CI_INTEGRATION_TESTS=true python -m pytest tests/integrations/persisters/ |