ci(github): add basic cicd #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: run-pytest | |
| on: | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| # JOB to run change detection | |
| changes: | |
| if: github.repository_owner == 'MiroMindAI' | |
| runs-on: ubuntu-latest | |
| # Required permissions | |
| permissions: | |
| pull-requests: read | |
| # Set job outputs to values from filter step | |
| outputs: | |
| lib_miroflow: ${{ steps.filter.outputs.lib_miroflow }} | |
| lib_miroflow_tool: ${{ steps.filter.outputs.lib_miroflow_tool }} | |
| lib_miroflow_contrib: ${{ steps.filter.outputs.lib_miroflow_contrib }} | |
| steps: | |
| # For pull requests it's not necessary to checkout the code | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| lib_miroflow: | |
| - 'libs/miroflow/**' | |
| lib_miroflow_tool: | |
| - 'libs/miroflow-tool/**' | |
| lib_miroflow_contrib: | |
| - 'libs/miroflow-contrib/**' | |
| app_run_agent: | |
| - 'apps/run-agent/**' | |
| app_prepare_benchmark: | |
| - 'apps/prepare-benchmark/**' | |
| # JOB to run when change happens in `libs/miroflow` | |
| lib-miroflow: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.lib_miroflow == 'true' }} | |
| name: check if PR breaks libs/miroflow pytest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install the project | |
| run: uv sync --directory libs/miroflow --locked --group dev | |
| - name: run pytest | |
| run: uv run --directory libs/miroflow pytest tests | |
| env: | |
| E2B_API_KEY: ${{ secrets.E2B_API_KEY }} | |
| SERPER_API_KEY: ${{ secrets.SERPER_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # JOB to run when change happens in `libs/miroflow-contrib` | |
| lib-miroflow-contrib: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.lib_miroflow_contrib == 'true' }} | |
| name: check if PR breaks libs/miroflow-contrib pytest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install the project | |
| run: uv sync --directory libs/miroflow-contrib --locked --group dev | |
| - name: run pytest | |
| run: uv run --directory libs/miroflow-contrib pytest tests | |
| env: | |
| E2B_API_KEY: ${{ secrets.E2B_API_KEY }} | |
| SERPER_API_KEY: ${{ secrets.SERPER_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # JOB to run when change happens in `libs/miroflow-tool` | |
| lib-miroflow-tool: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.lib_miroflow_tool == 'true' }} | |
| name: check if PR breaks libs/miroflow-tool pytest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install the project | |
| run: uv sync --directory libs/miroflow-tool --locked --group dev | |
| - name: run pytest | |
| run: uv run --directory libs/miroflow-tool pytest tests | |
| env: | |
| E2B_API_KEY: ${{ secrets.E2B_API_KEY }} | |
| SERPER_API_KEY: ${{ secrets.SERPER_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |