Skip to content

Commit

Permalink
Update GitHub actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Jan 16, 2025
1 parent be8bd2a commit df7bdff
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 45 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/jupyterlab-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: tests
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/jupyterlab-tests.yml'
- '**.py'
- '**.ts'
- '**.tsx'
- 'optuna_dashboard/package.json'
- 'optuna_dashboard/package-lock.json'
- 'tslib/react/package.json'
- 'tslib/react/package-lock.json'
- 'tslib/storage/package.json'
- 'tslib/storage/package-lock.json'
- 'jupyterlab/pyproject.toml'
- 'jupyterlab/package.json'
- 'jupyterlab/yarn.lock'
jobs:
test-build:
name: Test build for JupyterLab extension
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64

- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools build
pip install --progress-bar off jupyterlab
pip install --progress-bar off .
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- run: make tslib

- name: Build JavaScript dependencies
working-directory: optuna_dashboard
run: |
npm install
npm run build:pkg
# Without a following step, it will be failed to build the jupyter lab extension by the below error
# Type Error Cannot read properties of undefined (reading .../jupyterlab/.pnp.cjs)
- name: Mysterious hack to fix the build error
working-directory: jupyterlab
run: yarn install

- name: Build package
working-directory: jupyterlab
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: python -m build --sdist

45 changes: 0 additions & 45 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,49 +106,4 @@ jobs:
- name: Run python unit tests
run: |
pytest python_tests
test-build:
name: Test build for JupyterLab extension
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64

- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools build
pip install --progress-bar off jupyterlab
pip install --progress-bar off .
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- run: make tslib

- name: Build JavaScript dependencies
working-directory: optuna_dashboard
run: |
npm install
npm run build:pkg
# Without a following step, it will be failed to build the jupyter lab extension by the below error
# Type Error Cannot read properties of undefined (reading .../jupyterlab/.pnp.cjs)
- name: Mysterious hack to fix the build error
working-directory: jupyterlab
run: yarn install

- name: Build package
working-directory: jupyterlab
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: python -m build --sdist
2 changes: 2 additions & 0 deletions .github/workflows/typescript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- 'optuna_dashboard/package-lock.json'
- 'vscode/package.json'
- 'vscode/package-lock.json'
- 'standalone_app/package.json'
- 'standalone_app/package-lock.json'
- 'tslib/react/package.json'
- 'tslib/react/package-lock.json'
- 'tslib/storage/package.json'
Expand Down

0 comments on commit df7bdff

Please sign in to comment.