Add CI #1
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: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # Update python version matrix compatible with your project | |
| python: ["3.10", "3.11", "3.12"] | |
| env: | |
| # Use API Key from GA's environment variables for testing. You can remove this line if you don't need it. | |
| SERVICE_API_KEY: ${{ secrets.SERVICE_API_KEY }} | |
| steps: | |
| # This will remove unnecessary files to free up space. This has done because some package needs more space to install. e.g.) torch | |
| - name: Clean up space for action | |
| run: rm -rf /opt/hostedtoolcache | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| # Install project dependencies with pytest and run tests | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt pytest | |
| # `-rs` flag is used to debug for the test failure | |
| - name: Run test | |
| run: python -m pytest -rs tests |