123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- name: ci
- on:
- push:
- branches: [main]
- paths:
- - 'mem0/**'
- - 'tests/**'
- - 'embedchain/**'
- - 'embedchain/tests/**'
- - 'embedchain/examples/**'
- pull_request:
- paths:
- - 'mem0/**'
- - 'tests/**'
- - 'embedchain/**'
- - 'embedchain/tests/**'
- - 'embedchain/examples/**'
- jobs:
- check_changes:
- runs-on: ubuntu-latest
- outputs:
- mem0_changed: ${{ steps.filter.outputs.mem0 }}
- embedchain_changed: ${{ steps.filter.outputs.embedchain }}
- steps:
- - uses: actions/checkout@v3
- - uses: dorny/paths-filter@v2
- id: filter
- with:
- filters: |
- mem0:
- - 'mem0/**'
- - 'tests/**'
- embedchain:
- - 'embedchain/**'
- - 'embedchain/tests/**'
- - 'embedchain/examples/**'
- build_mem0:
- needs: check_changes
- if: ${{ needs.check_changes.outputs.mem0_changed == 'true' || (needs.check_changes.outputs.mem0_changed == 'false' && needs.check_changes.outputs.embedchain_changed == 'false') }}
- runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: ["3.10", "3.11"]
- steps:
- - uses: actions/checkout@v3
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
- - name: Install poetry
- uses: snok/install-poetry@v1
- with:
- version: 1.4.2
- virtualenvs-create: true
- virtualenvs-in-project: true
- - name: Load cached venv
- id: cached-poetry-dependencies
- uses: actions/cache@v2
- with:
- path: .venv
- key: venv-mem0-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- - name: Install dependencies
- run: make install_all
- if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- - name: Run tests and generate coverage report
- run: make test
- build_embedchain:
- needs: check_changes
- if: ${{ needs.check_changes.outputs.embedchain_changed == 'true' || (needs.check_changes.outputs.mem0_changed == 'false' && needs.check_changes.outputs.embedchain_changed == 'false') }}
- runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: ["3.9", "3.10", "3.11"]
- steps:
- - uses: actions/checkout@v3
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
- - name: Install poetry
- uses: snok/install-poetry@v1
- with:
- version: 1.4.2
- virtualenvs-create: true
- virtualenvs-in-project: true
- - name: Load cached venv
- id: cached-poetry-dependencies
- uses: actions/cache@v2
- with:
- path: .venv
- key: venv-embedchain-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- - name: Install dependencies
- run: cd embedchain && make install_all
- if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- - name: Lint with ruff
- run: cd embedchain && make lint
- - name: Run tests and generate coverage report
- run: cd embedchain && make coverage
- - name: Upload coverage reports to Codecov
- uses: codecov/codecov-action@v3
- with:
- file: coverage.xml
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|