♻️ remove .env.test dependency from tests #46
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: Test | |
| on: [push, pull_request] | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10'] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Ubuntu cache | |
| uses: actions/cache@v4 | |
| if: startsWith(matrix.os, 'ubuntu') | |
| with: | |
| path: ~/.cache/pip | |
| key: | |
| ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ matrix.os }}-${{ matrix.python-version }}- | |
| - name: macOS cache | |
| uses: actions/cache@v4 | |
| if: startsWith(matrix.os, 'macOS') | |
| with: | |
| path: ~/Library/Caches/pip | |
| key: | |
| ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ matrix.os }}-${{ matrix.python-version }}- | |
| - name: Windows cache | |
| uses: actions/cache@v4 | |
| if: startsWith(matrix.os, 'windows') | |
| with: | |
| path: c:\users\runneradmin\appdata\local\pip\cache | |
| key: | |
| ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ matrix.os }}-${{ matrix.python-version }}- | |
| - 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 --upgrade pip | |
| python -m pip install --upgrade poetry | |
| poetry install | |
| - name: Test | |
| shell: bash | |
| run: | | |
| poetry run coverage run -m pytest tests/ -s | |
| poetry run coverage xml | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| - name: Report Coverage | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' | |
| uses: codecov/codecov-action@v1.0.6 |