SK-3014-gitleaks-detection-fix #21
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: PR CI Checks (flowvault) | |
| # flowvault is a folder under main, alongside skyvault - not a branch. | |
| # This workflow fires for PRs targeting main or a flowvault-release/* branch | |
| # that actually touch flowvault or its common dependency, and only builds/ | |
| # tests those two modules. skyvault (and the full 3-module suite) is covered | |
| # by pr.yml, not here. | |
| on: | |
| pull_request: | |
| branches: [ "main", "flowvault-release/**" ] | |
| paths: | |
| - "flowvault/**" | |
| - "common/**" | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' | |
| # flowvault depends on common as a local path dependency, so common | |
| # must be built and installed first or flowvault's own build/install | |
| # will fail to resolve it. | |
| - name: Build and install common | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| cd common | |
| python setup.py sdist bdist_wheel | |
| pip install dist/*.whl | |
| - name: Build flowvault | |
| run: | | |
| cd flowvault | |
| python setup.py sdist bdist_wheel | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' | |
| - name: create-json | |
| id: create-json | |
| uses: jsdaniell/create-json@1.1.2 | |
| with: | |
| name: "credentials.json" | |
| json: ${{ secrets.VALID_SKYFLOW_CREDS_TEST }} | |
| - name: Run flowvault unit tests | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel coverage | |
| cp credentials.json flowvault/credentials.json | |
| # flowvault depends on common as a local path dependency. | |
| cd common | |
| python setup.py sdist bdist_wheel | |
| pip install dist/*.whl | |
| cd .. | |
| cd flowvault | |
| python setup.py sdist bdist_wheel | |
| pip install dist/*.whl | |
| if [ -f requirements.txt ]; then | |
| pip install -r requirements.txt | |
| fi | |
| python -m coverage run --source=. -m unittest discover | |
| coverage xml -o test-coverage.xml | |
| - name: Codecov | |
| uses: codecov/codecov-action@v2.1.0 | |
| with: | |
| token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | |
| files: flowvault/test-coverage.xml | |
| flags: flowvault | |
| name: codecov-skyflow-python-flowvault | |
| verbose: true | |
| smoke: | |
| name: Clean-install smoke test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' | |
| # Build the wheel (it bundles the sibling common/ tree via setup.py's | |
| # custom build_py), then install ONLY that wheel into a fresh virtualenv | |
| # and import it. The venv contains just the wheel's declared runtime | |
| # dependencies, so a dependency missing from setup.py fails the import | |
| # here -- the unit-test job installs dev deps and would mask it. | |
| - name: Build the flowvault wheel | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| cd flowvault | |
| python setup.py bdist_wheel | |
| - name: Install the wheel in a clean venv and import | |
| run: | | |
| python -m venv /tmp/smoke | |
| /tmp/smoke/bin/pip install --upgrade pip | |
| /tmp/smoke/bin/pip install flowvault/dist/*.whl | |
| # Import from outside the repo so the source tree (flowvault/skyflow, | |
| # ./common) is not on sys.path -- this exercises the installed wheel. | |
| cd /tmp | |
| /tmp/smoke/bin/python -c "import skyflow, common; from skyflow import Skyflow, Env, LogLevel; from skyflow.vault.data import InsertRequest, GetRequest, UpdateRequest, DeleteRequest, DetokenizeRequest, InsertOptions, GetOptions, UpdateOptions, DeleteOptions, DetokenizeOptions; from skyflow.vault.controller import VaultController; print('clean-install import OK')" |