feat: add integration tests to CI #1144
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| actions: read | |
| contents: read | |
| packages: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint & Format | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run ESLint | |
| run: npm run lint | |
| - name: Check Prettier formatting | |
| run: npm run format | |
| typecheck: | |
| name: TypeCheck | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run TypeScript type checking | |
| run: npm run typecheck | |
| qlty: | |
| name: Qlty Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install qlty | |
| uses: qltysh/qlty-action/install@92420f3093ba65970fed22ce5f162ecb8a5c1700 | |
| - name: Run qlty check | |
| run: qlty check | |
| - name: Run qlty code smells analysis | |
| run: qlty smells | |
| build: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Compile TypeScript | |
| run: npm run compile | |
| - name: Run tests | |
| run: npm test | |
| env: | |
| VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE: true | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 | |
| with: | |
| use_oidc: true | |
| files: coverage/lcov.info | |
| fail_ci_if_error: true | |
| - name: Upload test results to Codecov | |
| if: '!cancelled()' | |
| uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1 | |
| with: | |
| use_oidc: true | |
| files: test-results.xml | |
| fail_ci_if_error: true | |
| - name: Check dependencies | |
| run: npm run checkDependencies | |
| continue-on-error: true | |
| - name: Check licenses | |
| run: npm run check-licenses | |
| check_licenses: | |
| name: Check Licenses | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check Licenses | |
| run: npm run check-licenses | |
| spell-check: | |
| name: Spell Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run spell check | |
| run: npm run spell-check | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: read | |
| env: | |
| VSC_JUPYTER_FORCE_LOGGING: 'true' | |
| VSC_PYTHON_FORCE_LOGGING: 'true' | |
| VSC_JUPYTER_CI_TEST_VSC_CHANNEL: 'insiders' | |
| DISABLE_INSIDERS_EXTENSION: 1 | |
| PYTHON_VERSION: '3.12' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| id: setupPythonVersion | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Set CI Python Path | |
| run: echo "CI_PYTHON_PATH=${{ steps.setupPythonVersion.outputs.python-path }}" >> $GITHUB_ENV | |
| # Cache pip dependencies | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('build/venv-test-ipywidgets8-requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}- | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Python test requirements | |
| run: | | |
| python --version | |
| python -c "import sys;print(sys.executable)" | |
| python -m pip install --upgrade pip wheel | |
| python -m pip --disable-pip-version-check install -r build/venv-test-ipywidgets8-requirements.txt | |
| python -m pip install packaging | |
| python ./pythonFiles/install_debugpy.py | |
| python -m ipykernel install --user | |
| - name: Install screen capture dependencies | |
| run: sudo apt-get update && sudo apt-get install --fix-missing imagemagick x11-xserver-utils | |
| - name: Compile TypeScript | |
| run: npm run compile | |
| env: | |
| VSC_JUPYTER_CI_FAST_COMPILATION: 1 | |
| - name: Create temp folder for user data dir | |
| run: | | |
| echo "VSC_JUPYTER_USER_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV | |
| echo ${{env.VSC_JUPYTER_USER_DATA_DIR}} is user data dir | |
| - name: Set xvfb parameters | |
| run: echo "xvfbCommand=--server-args=\"-screen 0 1024x768x24\"" >> $GITHUB_ENV | |
| - name: Run integration tests | |
| uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7 | |
| with: | |
| run: ${{ env.xvfbCommand }} npm run test:integration | |
| env: | |
| VSC_JUPYTER_FORCE_LOGGING: 1 | |
| VSC_PYTHON_FORCE_LOGGING: 1 | |
| VSC_JUPYTER_CI_TEST_VSC_CHANNEL: 'insiders' | |
| - name: Upload VS Code logs | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: VSCodeLogs-integration-tests | |
| path: '${{env.VSC_JUPYTER_USER_DATA_DIR}}/logs/**/*' | |
| retention-days: 7 | |
| - name: Upload test result files | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: TestLogs-integration-tests | |
| path: './logs/*' | |
| retention-days: 7 | |
| audit-prod: | |
| name: Audit - Production | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run audit for production dependencies | |
| run: npm audit --production | |
| audit-all: | |
| name: Audit - All | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| cache: 'npm' | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@deepnote' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline --no-audit | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run audit for all dependencies | |
| run: npm audit |