|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: main |
| 6 | + pull_request: |
| 7 | + branches: '*' |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v3 |
| 20 | + |
| 21 | + - name: Base Setup |
| 22 | + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: python -m pip install -U "jupyterlab>=4.0.0,<5" |
| 26 | + |
| 27 | + - name: Lint the extension |
| 28 | + run: | |
| 29 | + set -eux |
| 30 | + jlpm |
| 31 | + jlpm run lint:check |
| 32 | +
|
| 33 | + - name: Test the extension |
| 34 | + run: | |
| 35 | + set -eux |
| 36 | + jlpm run test |
| 37 | +
|
| 38 | + - name: Build the extension |
| 39 | + run: | |
| 40 | + set -eux |
| 41 | + python -m pip install .[test] |
| 42 | +
|
| 43 | + pytest -vv -r ap --cov jupyterlab_unianalytics_dashboard |
| 44 | + jupyter server extension list |
| 45 | + jupyter server extension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK" |
| 46 | +
|
| 47 | + jupyter labextension list |
| 48 | + jupyter labextension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK" |
| 49 | + python -m jupyterlab.browser_check |
| 50 | +
|
| 51 | + - name: Package the extension |
| 52 | + run: | |
| 53 | + set -eux |
| 54 | +
|
| 55 | + pip install build |
| 56 | + python -m build |
| 57 | + pip uninstall -y "jupyterlab_unianalytics_dashboard" jupyterlab |
| 58 | +
|
| 59 | + - name: Upload extension packages |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: extension-artifacts |
| 63 | + path: dist/jupyterlab_unianalytics_dashboard* |
| 64 | + if-no-files-found: error |
| 65 | + |
| 66 | + test_isolated: |
| 67 | + needs: build |
| 68 | + runs-on: ubuntu-latest |
| 69 | + |
| 70 | + steps: |
| 71 | + - name: Install Python |
| 72 | + uses: actions/setup-python@v4 |
| 73 | + with: |
| 74 | + python-version: '3.9' |
| 75 | + architecture: 'x64' |
| 76 | + - uses: actions/download-artifact@v4 |
| 77 | + with: |
| 78 | + name: extension-artifacts |
| 79 | + - name: Install and Test |
| 80 | + run: | |
| 81 | + set -eux |
| 82 | + # Remove NodeJS, twice to take care of system and locally installed node versions. |
| 83 | + sudo rm -rf $(which node) |
| 84 | + sudo rm -rf $(which node) |
| 85 | +
|
| 86 | + pip install "jupyterlab>=4.0.0,<5" jupyterlab_unianalytics_dashboard*.whl |
| 87 | +
|
| 88 | +
|
| 89 | + jupyter server extension list |
| 90 | + jupyter server extension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK" |
| 91 | +
|
| 92 | + jupyter labextension list |
| 93 | + jupyter labextension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK" |
| 94 | + python -m jupyterlab.browser_check --no-browser-test |
| 95 | +
|
| 96 | + integration-tests: |
| 97 | + name: Integration tests |
| 98 | + needs: build |
| 99 | + runs-on: ubuntu-latest |
| 100 | + |
| 101 | + env: |
| 102 | + PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers |
| 103 | + |
| 104 | + steps: |
| 105 | + - name: Checkout |
| 106 | + uses: actions/checkout@v3 |
| 107 | + |
| 108 | + - name: Base Setup |
| 109 | + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 110 | + |
| 111 | + - name: Download extension package |
| 112 | + uses: actions/download-artifact@v4 |
| 113 | + with: |
| 114 | + name: extension-artifacts |
| 115 | + |
| 116 | + - name: Install the extension |
| 117 | + run: | |
| 118 | + set -eux |
| 119 | + python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_unianalytics_dashboard*.whl |
| 120 | +
|
| 121 | + - name: Install dependencies |
| 122 | + working-directory: ui-tests |
| 123 | + env: |
| 124 | + YARN_ENABLE_IMMUTABLE_INSTALLS: 0 |
| 125 | + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 |
| 126 | + run: jlpm install |
| 127 | + |
| 128 | + - name: Set up browser cache |
| 129 | + uses: actions/cache@v3 |
| 130 | + with: |
| 131 | + path: | |
| 132 | + ${{ github.workspace }}/pw-browsers |
| 133 | + key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }} |
| 134 | + |
| 135 | + - name: Install browser |
| 136 | + run: jlpm playwright install chromium |
| 137 | + working-directory: ui-tests |
| 138 | + |
| 139 | + - name: Execute integration tests |
| 140 | + working-directory: ui-tests |
| 141 | + run: | |
| 142 | + jlpm playwright test |
| 143 | +
|
| 144 | + - name: Upload Playwright Test report |
| 145 | + if: always() |
| 146 | + uses: actions/upload-artifact@v4 |
| 147 | + with: |
| 148 | + name: jupyterlab_unianalytics_dashboard-playwright-tests |
| 149 | + path: | |
| 150 | + ui-tests/test-results |
| 151 | + ui-tests/playwright-report |
| 152 | +
|
| 153 | + # check_links: |
| 154 | + # name: Check Links |
| 155 | + # runs-on: ubuntu-latest |
| 156 | + # timeout-minutes: 15 |
| 157 | + # steps: |
| 158 | + # - uses: actions/checkout@v3 |
| 159 | + # - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 160 | + # - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 |
0 commit comments