CF.Cumulus-Databricks-CICD-Unit-Test #61
Workflow file for this run
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: CF.Cumulus-Databricks-CICD-Unit-Test | |
| concurrency: 1 | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| deploy_dev: | |
| name: "Deploy unit test to dev" | |
| runs-on: ubuntu-latest | |
| environment: dev | |
| defaults: | |
| run: | |
| working-directory: ./src/azure.databricks/python | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - run: python -m pip install --upgrade pip | |
| - run: pip install wheel | |
| - run: pip3 install wheel | |
| - run: pip install -r requirements.txt | |
| - run: | | |
| pip install databricks-cli | |
| echo "[dev]" >> ~/.databrickscfg | |
| echo "host = ${{ secrets.DATABRICKS_HOST }}" >> ~/.databrickscfg | |
| echo "token = ${{ secrets.DATABRICKS_TOKEN }}" >> ~/.databrickscfg | |
| - name: Set up Databricks CLI | |
| uses: databricks/setup-cli@main | |
| - name: Cleanup old code | |
| run: databricks workspace delete /Workspace/Shared/UnitTest --recursive | |
| continue-on-error: true | |
| env: | |
| DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} | |
| DATABRICKS_BUNDLE_ENV: dev | |
| - name: Deploy DAB | |
| run: databricks bundle deploy --target unit-test --profile dev | |
| env: | |
| DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} | |
| DATABRICKS_BUNDLE_ENV: dev | |
| - name: Run unit tests | |
| run: databricks bundle run run_unit_tests -p dev | |
| env: | |
| DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} | |
| DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} | |