Update cypress-tests.yml #105
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: Run Cypress Test | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["Upload Python Package"] | |
| types: | |
| - completed | |
| push: | |
| branches: | |
| - next | |
| permissions: | |
| contents: read | |
| jobs: | |
| run-cypress-tests: | |
| name: Run Cypress Tests | |
| runs-on: ubuntu-latest | |
| #if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'corretto' | |
| java-version: '11' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Set environment variables for Cypress | |
| run: | | |
| echo "POSTGRES_CONNECTION_STRING=${{ secrets.POSTGRES_CONNECTION_STRING }}" >> $GITHUB_ENV | |
| echo "DATABRICKS_HOSTNAME=${{ secrets.DATABRICKS_HOSTNAME }}" >> $GITHUB_ENV | |
| echo "DATABRICKS_HTTP_PATH=${{ secrets.DATABRICKS_HTTP_PATH }}" >> $GITHUB_ENV | |
| echo "DATABRICKS_ACCESS_TOKEN=${{ secrets.DATABRICKS_ACCESS_TOKEN }}" >> $GITHUB_ENV | |
| - name: Run Java version check | |
| run: java -version | |
| - name: Run Python version check | |
| run: python --version | |
| - name: Get the latest pre-release tag and install Dataforge | |
| run: | | |
| prerelease_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases | jq -r 'map(select(.prerelease == true)) | .[0].tag_name') | |
| if [ "$prerelease_tag" != "null" ]; then | |
| echo "The latest pre-release tag is: $prerelease_tag" | |
| pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ dataforge-core=="$prerelease_tag" | |
| else | |
| echo "No pre-release found." | |
| fi | |
| - name: Run Dataforge version check | |
| run: dataforge --version | |
| - name: Run interactive Dataforge configuration | |
| env: | |
| POSTGRES_CONNECTION_STRING: ${{ secrets.POSTGRES_CONNECTION_STRING }} | |
| DATABRICKS_HOSTNAME: ${{ secrets.DATABRICKS_HOSTNAME }} | |
| DATABRICKS_HTTP_PATH: ${{ secrets.DATABRICKS_HTTP_PATH }} | |
| DATABRICKS_ACCESS_TOKEN: ${{ secrets.DATABRICKS_ACCESS_TOKEN }} | |
| run: node scripts/runInteractiveCommand.js --configure | |
| - name: Initialize Dataforge | |
| run: dataforge --init | |
| - name: Run interactive Dataforge seeding | |
| run: node scripts/runInteractiveCommand.js --seed | |
| - name: Run Dataforge build | |
| run: dataforge --build | |
| - name: Run Dataforge process | |
| run: dataforge --run |