Cloud integration #724
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: Cloud integration | |
| # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows | |
| on: | |
| push: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" # every day at midnight UTC | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| integration: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-22.04", "macOS-14", "windows-2022"] | |
| python-version: ["3.10"] | |
| requires: ["latest"] | |
| include: | |
| - { os: "ubuntu-22.04", python-version: "3.10", requires: "oldest" } | |
| # Timeout: https://stackoverflow.com/a/59076067/4521646 | |
| timeout-minutes: 25 | |
| env: | |
| TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" | |
| DISABLE_MPS: ${{ matrix.os == 'macOS-14' && '1' || '0' }} | |
| UV_TORCH_BACKEND: "cpu" | |
| LIGHTNING_CLOUD_URL: https://staging.gridai.dev | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv and set Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| activate-environment: true | |
| enable-cache: true | |
| - name: Set min. dependencies | |
| if: matrix.requires == 'oldest' | |
| run: | | |
| uv pip install 'lightning-utilities[cli]' | |
| python -m lightning_utilities.cli requirements set-oldest --req_files='["requirements.txt", "pyproject.toml"]' | |
| - name: Install package & dependencies | |
| run: | | |
| uv --version | |
| uv pip install -e '.[test,extra]' --find-links="${TORCH_URL}" | |
| uv pip list | |
| - name: Test integrations | |
| env: | |
| LIGHTNING_USER_ID: ${{ secrets.LIGHTNING_USER_ID }} | |
| LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }} | |
| run: | | |
| coverage run --source litmodels -m pytest src tests -v -m cloud | |
| timeout-minutes: 15 | |
| - name: Statistics | |
| run: | | |
| coverage report | |
| coverage xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: integrations | |
| env_vars: OS,PYTHON | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci | |
| integration-guardian: | |
| runs-on: ubuntu-latest | |
| needs: integration | |
| if: always() | |
| steps: | |
| - run: echo "${{ needs.integration.result }}" | |
| - name: failing... | |
| if: needs.integration.result == 'failure' | |
| run: exit 1 | |
| - name: cancelled or skipped... | |
| if: contains(fromJSON('["cancelled", "skipped"]'), needs.integration.result) | |
| timeout-minutes: 1 | |
| run: sleep 90 | |
| # todo add job to report failing tests with cron |