ci : create uv venv
#153
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: | |
| schedule: | |
| - cron: '45 01 30 * *' | |
| push: | |
| pull_request: | |
| branches: [main] | |
| fork: | |
| workflow_dispatch: | |
| jobs: | |
| badges: | |
| name: Add Google Colab Badges | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Create virtual environment | |
| run: uv venv | |
| - name: Install dependencies | |
| run: uv pip install beautifulsoup4 jupyter lxml | |
| - name: Add/Update badges | |
| run: uv run python ./utils/add_colab_main_buttons.py | |
| - name: Commit & push | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Clean ipynb ${{ github.sha }}" | |
| test_ipynb: | |
| needs: badges | |
| name: Test ipynb on ${{ matrix.environment.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| environment: | |
| - {name: '2021.11', python-version: "3.9.4"} | |
| - {name: 'nightly', python-version: "3"} | |
| fail-fast: false | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Create virtual environment | |
| run: uv venv test-env-${{ matrix.environment.name }} --python ${{ matrix.environment.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| source test-env-${{ matrix.environment.name }}/bin/activate | |
| uv pip install -r tests/requirements.${{ matrix.environment.name }}.txt | |
| - name: Run tests | |
| env: | |
| TEST_IPYNB_IGNORE_FOLDER: tutorial | |
| run: | | |
| source test-env-${{ matrix.environment.name }}/bin/activate | |
| uv run pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' tests/ |