From 56e500b12616b1b73e4760fd2d86a3905494cd51 Mon Sep 17 00:00:00 2001 From: krassowski Date: Tue, 8 Sep 2020 21:57:04 +0100 Subject: [PATCH 01/42] First attempt to setup GitHub actions --- .github/workflows/actions.yml | 25 ++++++ azure-pipelines.yml | 34 -------- ci/env-test.yml.in | 2 - ci/env_template.py | 5 +- ci/job.lint.yml | 48 ++++++----- ci/job.test.yml | 156 ++++++++++++++++++---------------- ci/steps.mamba.yml | 23 +---- 7 files changed, 136 insertions(+), 157 deletions(-) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 000000000..abfcd5299 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,25 @@ +name: Run acceptance tests +on: [push, pull_request] + +variables: + PYTHONUNBUFFERED: 1 + ATEST_RETRIES: 3 + YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn + + PY_JLSP_VERSION: 0.9.2 + JS_JLLSP_VERSION: 2.0.2 + JS_JLG2D_VERSION: 1.0.0 + + FIRST_PARTY_LABEXTENSIONS: >- + packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz + + LINKED_EXTENSIONS: >- + packages/lsp-ws-connection + packages/jupyterlab-go-to-definition + packages/completion-theme + packages/theme-vscode + packages/theme-material + +jobs: + - template: ci/job.lint.yml + - template: ci/job.test.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bd8cc8098..e69de29bb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,34 +0,0 @@ -trigger: - batch: true - branches: - include: - - master - - refs/tags/v* - -pr: - branches: - include: - - '*' - -variables: - PYTHONUNBUFFERED: 1 - ATEST_RETRIES: 3 - YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn - - PY_JLSP_VERSION: 0.9.2 - JS_JLLSP_VERSION: 2.0.2 - JS_JLG2D_VERSION: 1.0.0 - - FIRST_PARTY_LABEXTENSIONS: >- - packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz - - LINKED_EXTENSIONS: >- - packages/lsp-ws-connection - packages/jupyterlab-go-to-definition - packages/completion-theme - packages/theme-vscode - packages/theme-material - -jobs: - - template: ci/job.lint.yml - - template: ci/job.test.yml diff --git a/ci/env-test.yml.in b/ci/env-test.yml.in index 1bbaf53b8..930178ea7 100644 --- a/ci/env-test.yml.in +++ b/ci/env-test.yml.in @@ -6,7 +6,6 @@ channels: dependencies: # runtime dependencies - - python {python} - jupyterlab {lab} # build dependencies - nodejs {nodejs} @@ -27,7 +26,6 @@ dependencies: - chktex # test tools - pytest-asyncio - - pytest-azurepipelines - pytest-cov - pytest-flake8 - pytest-runner diff --git a/ci/env_template.py b/ci/env_template.py index 9f723ca69..2fb8b6402 100644 --- a/ci/env_template.py +++ b/ci/env_template.py @@ -3,8 +3,7 @@ Path("..", "env-test.yml").write_text( Path("env-test.yml.in").read_text().format( - python=sys.argv[1], - lab=sys.argv[2], - nodejs=sys.argv[3] + lab=sys.argv[1], + nodejs=sys.argv[2] ) ) diff --git a/ci/job.lint.yml b/ci/job.lint.yml index 252c056a9..ad0d21d0c 100644 --- a/ci/job.lint.yml +++ b/ci/job.lint.yml @@ -8,40 +8,42 @@ parameters: spec: '>=3.8,<3.9.0a0' lab: '>=2,<3.0.0a0' nodejs: '>=12,<13.0.0a0' - env_update: mamba env update -n jupyterlab-lsp --file env-test.yml --quiet - env_lint: mamba env update -n jupyterlab-lsp --file requirements/lint.yml --quiet + env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet + env_lint: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet jobs: - ${{ each platform in parameters.platforms }}: - ${{ each python in parameters.pythons}}: - job: Lint - pool: - vmImage: ${{ platform.vmImage }} + runs-on: ${{ platform.vmImage }} steps: - - template: steps.mamba.yml - parameters: - name: ${{ platform.name }} + - name: Set up Python and conda + uses: s-weigand/setup-conda@v1 + with: + update-conda: false + python-version: ${{ python.spec }} + conda-channels: anaconda, conda-forge - - script: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.spec }}" "${{ python.lab }}" "${{ python.nodejs }}" - displayName: generate env with python, lab, and nodejs version + - name: generate env with lab and node version + run: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.lab }}" "{{ python.nodejs }}" - - script: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }} - displayName: testing dependencies + - run: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }} + name: testing dependencies - - script: ${{ parameters.env_lint }} || ${{ parameters.env_lint }} || ${{ parameters.env_lint }} - displayName: linting dependencies + - run: ${{ parameters.env_lint }} || ${{ parameters.env_lint }} || ${{ parameters.env_lint }} + name: linting dependencies - - script: ${{ platform.activate }} jupyterlab-lsp && python scripts/integrity.py - displayName: check integrity of package versions + - run: ${{ platform.activate }} jupyterlab-lsp && python scripts/integrity.py + name: check integrity of package versions - - script: ${{ platform.activate }} jupyterlab-lsp && jlpm || jlpm || jlpm - displayName: install npm dependencies + - run: ${{ platform.activate }} jupyterlab-lsp && jlpm || jlpm || jlpm + name: install npm dependencies - - script: ${{ platform.activate }} jupyterlab-lsp && python scripts/lint.py - displayName: lint backend + - run: ${{ platform.activate }} jupyterlab-lsp && python scripts/lint.py + name: lint backend - - script: ${{ platform.activate }} jupyterlab-lsp && jlpm build:schema - displayName: build schema so linting can complete + - run: ${{ platform.activate }} jupyterlab-lsp && jlpm build:schema + name: build schema so linting can complete - - script: ${{ platform.activate }} jupyterlab-lsp && jlpm lint:check - displayName: lint frontend + - run: ${{ platform.activate }} jupyterlab-lsp && jlpm lint:check + name: lint frontend diff --git a/ci/job.test.yml b/ci/job.test.yml index 0210346d3..8ca71ce30 100644 --- a/ci/job.test.yml +++ b/ci/job.test.yml @@ -25,7 +25,7 @@ parameters: js_cov_packages: - jupyterlab-go-to-definition - jupyterlab-lsp - env_update: mamba env update -n base --file env-test.yml --quiet + env_update: conda env update -n base --file env-test.yml --quiet lab_link: jupyter labextension link --debug --no-build $(LINKED_EXTENSIONS) lab_ext: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) lab_build: jupyter lab build --debug --dev-build=False --minimize=True @@ -33,99 +33,109 @@ parameters: jobs: - ${{ each platform in parameters.platforms }}: - ${{ each python in parameters.pythons}}: - - job: ${{ platform.name }}${{ python.name }} - pool: - vmImage: ${{ platform.vmImage }} + - ${{ platform.name }}${{ python.name }}: + runs-on: ${{ platform.vmImage }} steps: - - template: steps.mamba.yml - parameters: - name: ${{ platform.name }} - packages: "'python${{ python.spec }}'" + - uses: actions/checkout@v2 + #- name: Use Node.js ${{ python.nodejs }} + # uses: actions/setup-node@v1 + # with: + # node-version: ${{ python.nodejs }} - - script: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.spec }}" "${{ python.lab }}" "${{ python.nodejs }}" - displayName: generate env with python, lab, and nodejs version + - name: Set up Python and conda + uses: s-weigand/setup-conda@v1 + with: + update-conda: false + python-version: ${{ python.spec }} + conda-channels: anaconda, conda-forge - - script: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }} - displayName: update conda environment with test dependencies + - run: conda --version + - run: which python - - script: conda info && conda list -n base - displayName: list conda info and packages + - name: generate env with lab and node version + run: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.lab }}" "{{ python.nodejs }}" - - script: ${{ platform.activate }} && jlpm || jlpm || jlpm - displayName: install npm dependencies + - name: update conda environment with test dependencies + run: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }} - - script: ${{ platform.activate }} && jlpm build - displayName: build typescript + - run: conda info && conda list -n base + name: list conda info and packages - - script: ${{ platform.activate }} && python setup.py sdist bdist_wheel - displayName: build python distributions + - run: ${{ platform.activate }} && jlpm || jlpm || jlpm + name: install npm dependencies - - script: ${{ platform.activate }} && jlpm lerna run bundle - displayName: build npm bundles + - run: ${{ platform.activate }} && jlpm build + name: build typerun - - script: ${{ platform.activate }} && cd dist && python -m pip install jupyter_lsp-$(PY_JLSP_VERSION)-py3-none-any.whl --no-deps - displayName: install python wheel + - run: ${{ platform.activate }} && python setup.py sdist bdist_wheel + name: build python distributions - - script: ${{ platform.activate }} && python scripts/jedi_cache.py - displayName: warm up jedi cache + - run: ${{ platform.activate }} && jlpm lerna run bundle + name: build npm bundles - - script: ${{ platform.activate }} && python scripts/tectonic_cache.py - displayName: warm up tectonic cache + - run: ${{ platform.activate }} && cd dist && python -m pip install jupyter_lsp-$(PY_JLSP_VERSION)-py3-none-any.whl --no-deps + name: install python wheel - - script: ${{ platform.activate }} && jlpm test - displayName: run frontend unit tests + - run: ${{ platform.activate }} && python scripts/jedi_cache.py + name: warm up jedi cache - - task: PublishTestResults@2 - displayName: publish frontend test results - inputs: - testResultsFiles: packages/**/junit.xml - testRunTitle: 'Jest ${{ platform.name }}${{ python.name }}' - mergeTestResults: true - condition: always() + - run: ${{ platform.activate }} && python scripts/tectonic_cache.py + name: warm up tectonic cache - - ${{ each js_package in parameters.js_cov_packages }}: - - task: PublishCodeCoverageResults@1 - displayName: 'publish ${{ js_package }} coverage' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: 'packages/${{ js_package }}/coverage/cobertura-coverage.xml' - condition: always() + - run: ${{ platform.activate }} && jlpm test + name: run frontend unit tests - - script: ${{ platform.activate }} && jupyter serverextension list - displayName: list server extensions + #- task: PublishTestResults@2 + # name: publish frontend test results + # inputs: + # testResultsFiles: packages/**/junit.xml + # testRunTitle: 'Jest ${{ platform.name }}${{ python.name }}' + # mergeTestResults: true + # condition: always() - - script: ${{ platform.activate }} && python scripts/utest.py --test-run-title="Pytest ${{ platform.name }}${{ python.name }}" - displayName: run python tests + #- ${{ each js_package in parameters.js_cov_packages }}: + # - task: PublishCodeCoverageResults@1 + # name: 'publish ${{ js_package }} coverage' + # inputs: + # codeCoverageTool: Cobertura + # summaryFileLocation: 'packages/${{ js_package }}/coverage/cobertura-coverage.xml' + # condition: always() - - script: ${{ platform.activate }} && ${{ parameters.lab_link }} || ${{ parameters.lab_link }} || ${{ parameters.lab_link }} - displayName: install support packages + - run: ${{ platform.activate }} && jupyter serverextension list + name: list server extensions - - script: ${{ platform.activate }} && ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} - displayName: install labextensions + - run: ${{ platform.activate }} && python scripts/utest.py --test-run-title="Pytest ${{ platform.name }}${{ python.name }}" + name: run python tests - - script: ${{ platform.activate }} && jupyter labextension list - displayName: list labextensions before build + - run: ${{ platform.activate }} && ${{ parameters.lab_link }} || ${{ parameters.lab_link }} || ${{ parameters.lab_link }} + name: install support packages - - script: ${{ platform.activate }} && ${{ parameters.lab_build }} || ${{ parameters.lab_build }} || ${{ parameters.lab_build }} - displayName: build lab + - run: ${{ platform.activate }} && ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} + name: install labextensions - - script: ${{ platform.activate }} && jupyter labextension list - displayName: list labextensions after build + - run: ${{ platform.activate }} && jupyter labextension list + name: list labextensions before build - - script: ${{ platform.activate }} && python scripts/atest.py --exclude expect:fail - displayName: run browser tests + - run: ${{ platform.activate }} && ${{ parameters.lab_build }} || ${{ parameters.lab_build }} || ${{ parameters.lab_build }} + name: build lab - - task: PublishTestResults@2 - displayName: publish browser test results - inputs: - testResultsFiles: atest/output/*.xunit.xml - testRunTitle: 'Robot ${{ platform.name }}${{ python.name }}' - mergeTestResults: true - condition: always() + - run: ${{ platform.activate }} && jupyter labextension list + name: list labextensions after build - - task: PublishPipelineArtifact@0 - displayName: publish browser test output - inputs: - targetPath: atest/output - artifactName: $(Agent.JobStatus) Robot ${{ platform.name }}${{ python.name }} $(Build.BuildId) - condition: always() + - run: ${{ platform.activate }} && python scripts/atest.py --exclude expect:fail + name: run browser tests + + #- task: PublishTestResults@2 + # name: publish browser test results + # inputs: + # testResultsFiles: atest/output/*.xunit.xml + # testRunTitle: 'Robot ${{ platform.name }}${{ python.name }}' + # mergeTestResults: true + # condition: always() + + #- task: PublishPipelineArtifact@0 + # name: publish browser test output + # inputs: + # targetPath: atest/output + # artifactName: $(Agent.JobStatus) Robot ${{ platform.name }}${{ python.name }} $(Build.BuildId) + # condition: always() diff --git a/ci/steps.mamba.yml b/ci/steps.mamba.yml index 3715d5e13..a5a804a29 100644 --- a/ci/steps.mamba.yml +++ b/ci/steps.mamba.yml @@ -1,22 +1 @@ -parameters: - name: Linux - install_cmd: conda install -yn base -c conda-forge --freeze-installed mamba conda=4.8.3 - -steps: - - ${{ if eq(parameters.name, 'Linux') }}: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: conda $PATH - - - ${{ if eq(parameters.name, 'MacOSX') }}: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: conda $PATH - - - bash: sudo chown -R $USER $CONDA - displayName: own conda - - - ${{ if eq(parameters.name, 'Windows') }}: - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: conda %PATH% - - - script: ${{ parameters.install_cmd }} || ${{ parameters.install_cmd }} || ${{ parameters.install_cmd }} - displayName: install mamba +# TODO remove - using action now From 1637ad155e0decc66c6bff713d1e1b9c035e8c97 Mon Sep 17 00:00:00 2001 From: krassowski Date: Tue, 8 Sep 2020 22:47:02 +0100 Subject: [PATCH 02/42] Less templates --- .github/workflows/actions.yml | 21 --------------------- {ci => .github/workflows}/env-test.yml.in | 0 {ci => .github/workflows}/env_template.py | 2 +- {ci => .github/workflows}/job.lint.yml | 8 ++++++++ {ci => .github/workflows}/job.test.yml | 21 +++++++++++++++++++++ ci/steps.mamba.yml | 1 - 6 files changed, 30 insertions(+), 23 deletions(-) rename {ci => .github/workflows}/env-test.yml.in (100%) rename {ci => .github/workflows}/env_template.py (77%) rename {ci => .github/workflows}/job.lint.yml (93%) rename {ci => .github/workflows}/job.test.yml (91%) delete mode 100644 ci/steps.mamba.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index abfcd5299..f6b492d5d 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,24 +1,3 @@ -name: Run acceptance tests -on: [push, pull_request] - -variables: - PYTHONUNBUFFERED: 1 - ATEST_RETRIES: 3 - YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn - - PY_JLSP_VERSION: 0.9.2 - JS_JLLSP_VERSION: 2.0.2 - JS_JLG2D_VERSION: 1.0.0 - - FIRST_PARTY_LABEXTENSIONS: >- - packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz - - LINKED_EXTENSIONS: >- - packages/lsp-ws-connection - packages/jupyterlab-go-to-definition - packages/completion-theme - packages/theme-vscode - packages/theme-material jobs: - template: ci/job.lint.yml diff --git a/ci/env-test.yml.in b/.github/workflows/env-test.yml.in similarity index 100% rename from ci/env-test.yml.in rename to .github/workflows/env-test.yml.in diff --git a/ci/env_template.py b/.github/workflows/env_template.py similarity index 77% rename from ci/env_template.py rename to .github/workflows/env_template.py index 2fb8b6402..1006aa838 100644 --- a/ci/env_template.py +++ b/.github/workflows/env_template.py @@ -1,7 +1,7 @@ from pathlib import Path import sys -Path("..", "env-test.yml").write_text( +Path("../..", "env-test.yml").write_text( Path("env-test.yml.in").read_text().format( lab=sys.argv[1], nodejs=sys.argv[2] diff --git a/ci/job.lint.yml b/.github/workflows/job.lint.yml similarity index 93% rename from ci/job.lint.yml rename to .github/workflows/job.lint.yml index ad0d21d0c..f27fb3c23 100644 --- a/ci/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -1,3 +1,6 @@ +name: Run acceptance tests +on: [push, pull_request] + parameters: platforms: - name: Linux @@ -11,6 +14,11 @@ parameters: env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet env_lint: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet +env: + PY_JLSP_VERSION: 0.9.2 + JS_JLLSP_VERSION: 2.0.2 + JS_JLG2D_VERSION: 1.0.0 + jobs: - ${{ each platform in parameters.platforms }}: - ${{ each python in parameters.pythons}}: diff --git a/ci/job.test.yml b/.github/workflows/job.test.yml similarity index 91% rename from ci/job.test.yml rename to .github/workflows/job.test.yml index 8ca71ce30..58b8bc748 100644 --- a/ci/job.test.yml +++ b/.github/workflows/job.test.yml @@ -30,6 +30,27 @@ parameters: lab_ext: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) lab_build: jupyter lab build --debug --dev-build=False --minimize=True +env: + # TODO extract these from files instead + PY_JLSP_VERSION: 0.9.2 + JS_JLLSP_VERSION: 2.0.2 + JS_JLG2D_VERSION: 1.0.0 + + PYTHONUNBUFFERED: 1 + ATEST_RETRIES: 3 + # TODO + # YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn + + FIRST_PARTY_LABEXTENSIONS: >- + packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz + + LINKED_EXTENSIONS: >- + packages/lsp-ws-connection + packages/jupyterlab-go-to-definition + packages/completion-theme + packages/theme-vscode + packages/theme-material + jobs: - ${{ each platform in parameters.platforms }}: - ${{ each python in parameters.pythons}}: diff --git a/ci/steps.mamba.yml b/ci/steps.mamba.yml deleted file mode 100644 index a5a804a29..000000000 --- a/ci/steps.mamba.yml +++ /dev/null @@ -1 +0,0 @@ -# TODO remove - using action now From caec4c74c1b80fd5d3ad52714558d2ed921f2d04 Mon Sep 17 00:00:00 2001 From: krassowski Date: Tue, 8 Sep 2020 22:48:14 +0100 Subject: [PATCH 03/42] Remove old files --- .github/workflows/actions.yml | 4 ---- azure-pipelines.yml | 0 2 files changed, 4 deletions(-) delete mode 100644 .github/workflows/actions.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index f6b492d5d..000000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,4 +0,0 @@ - -jobs: - - template: ci/job.lint.yml - - template: ci/job.test.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index e69de29bb..000000000 From 63fb4d4f306b0355fa28214089f6bde53566b612 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:09:17 +0100 Subject: [PATCH 04/42] Use miniconda and install mamba --- .github/workflows/job.lint.yml | 91 ++++++------ .github/workflows/job.test.yml | 257 ++++++++++++++++----------------- 2 files changed, 166 insertions(+), 182 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index f27fb3c23..31ae56976 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -1,18 +1,12 @@ name: Run acceptance tests on: [push, pull_request] -parameters: - platforms: - - name: Linux - vmImage: ubuntu-16.04 - activate: source activate - pythons: - - name: ThreeSeven - spec: '>=3.8,<3.9.0a0' - lab: '>=2,<3.0.0a0' - nodejs: '>=12,<13.0.0a0' - env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet - env_lint: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet +strategy: + matrix: + os: [ubuntu-16.04] + python: [3.8] + nodejs: ['>=12,<13.0.0a0'] + lap: '>=2,<3.0.0a0' env: PY_JLSP_VERSION: 0.9.2 @@ -20,38 +14,41 @@ env: JS_JLG2D_VERSION: 1.0.0 jobs: - - ${{ each platform in parameters.platforms }}: - - ${{ each python in parameters.pythons}}: - - job: Lint - runs-on: ${{ platform.vmImage }} - steps: - - name: Set up Python and conda - uses: s-weigand/setup-conda@v1 - with: - update-conda: false - python-version: ${{ python.spec }} - conda-channels: anaconda, conda-forge - - - name: generate env with lab and node version - run: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.lab }}" "{{ python.nodejs }}" - - - run: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }} - name: testing dependencies - - - run: ${{ parameters.env_lint }} || ${{ parameters.env_lint }} || ${{ parameters.env_lint }} - name: linting dependencies - - - run: ${{ platform.activate }} jupyterlab-lsp && python scripts/integrity.py - name: check integrity of package versions - - - run: ${{ platform.activate }} jupyterlab-lsp && jlpm || jlpm || jlpm - name: install npm dependencies - - - run: ${{ platform.activate }} jupyterlab-lsp && python scripts/lint.py - name: lint backend - - - run: ${{ platform.activate }} jupyterlab-lsp && jlpm build:schema - name: build schema so linting can complete - - - run: ${{ platform.activate }} jupyterlab-lsp && jlpm lint:check - name: lint frontend + - Lint: + runs-on: ${{ matrix.os }} + defaults: + shell: bash -l {0} + steps: + - name: Set up Python and conda + uses: goanpeca/setup-miniconda@v1 + with: + python-version: ${{ matrix.python }} + conda-channels: conda-forge, anaconda + channel-priority: true + mamba-version: "*" + auto-activate-base: true + auto-update-conda: false + + - name: generate env with lab and node version + run: cd .github/workflows && python env_template.py "${{ matrix.lab }}" "{{ matrix.nodejs }}" + + - name: testing dependencies + run: conda env update -n jupyterlab-lsp --file env-test.yml --quiet + + - name: linting dependencies + run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet + + - name: check integrity of package versions + run: jupyterlab-lsp && python scripts/integrity.py + + - name: install npm dependencies + run: jupyterlab-lsp && jlpm || jlpm || jlpm + + - name: lint backend + run: jupyterlab-lsp && python scripts/lint.py + + - name: build schema so linting can complete + run: jupyterlab-lsp && jlpm build:schema + + - name: lint frontend + run: jupyterlab-lsp && jlpm lint:check diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 58b8bc748..dda5557ff 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,34 +1,18 @@ -parameters: - platforms: - - name: Linux - vmImage: ubuntu-16.04 - activate: source activate base - - name: MacOSX - vmImage: macos-10.14 - activate: source activate base - - name: Windows - vmImage: vs2017-win2016 - activate: call activate base - pythons: - - name: ThreeSix - spec: '=3.6' - lab: '>=2.2.0,<3.0.0a0' - nodejs: '>=10,<11.0.0.a0' - - name: ThreeSeven - spec: '=3.7' - lab: '>=2.2.0,<3.0.0a0' - nodejs: '>=12,<13.0.0a0' - - name: ThreeEight - spec: '=3.8' - lab: '>=2.2.0,<3.0.0a0' - nodejs: '>=13,<14.0.0a0' +vars: js_cov_packages: - jupyterlab-go-to-definition - jupyterlab-lsp - env_update: conda env update -n base --file env-test.yml --quiet - lab_link: jupyter labextension link --debug --no-build $(LINKED_EXTENSIONS) + env_update: + lab_link: lab_ext: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) - lab_build: jupyter lab build --debug --dev-build=False --minimize=True + lab_build: + +strategy: + matrix: + python: [3.6, 3.7, 3.8] + os: [ubuntu-16.04, macos-10.14, vs2017-win2016] + nodejs: ['>=10,<11.0.0.a0', '>=2.2.0,<3.0.0a0', '>=13,<14.0.0a0'] + lab: ['>=2.2.0,<3.0.0a0'] env: # TODO extract these from files instead @@ -52,111 +36,114 @@ env: packages/theme-material jobs: - - ${{ each platform in parameters.platforms }}: - - ${{ each python in parameters.pythons}}: - - ${{ platform.name }}${{ python.name }}: - runs-on: ${{ platform.vmImage }} - steps: - - uses: actions/checkout@v2 - #- name: Use Node.js ${{ python.nodejs }} - # uses: actions/setup-node@v1 - # with: - # node-version: ${{ python.nodejs }} - - - name: Set up Python and conda - uses: s-weigand/setup-conda@v1 - with: - update-conda: false - python-version: ${{ python.spec }} - conda-channels: anaconda, conda-forge - - - run: conda --version - - run: which python - - - name: generate env with lab and node version - run: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.lab }}" "{{ python.nodejs }}" - - - name: update conda environment with test dependencies - run: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }} - - - run: conda info && conda list -n base - name: list conda info and packages - - - run: ${{ platform.activate }} && jlpm || jlpm || jlpm - name: install npm dependencies - - - run: ${{ platform.activate }} && jlpm build - name: build typerun - - - run: ${{ platform.activate }} && python setup.py sdist bdist_wheel - name: build python distributions - - - run: ${{ platform.activate }} && jlpm lerna run bundle - name: build npm bundles - - - run: ${{ platform.activate }} && cd dist && python -m pip install jupyter_lsp-$(PY_JLSP_VERSION)-py3-none-any.whl --no-deps - name: install python wheel - - - run: ${{ platform.activate }} && python scripts/jedi_cache.py - name: warm up jedi cache - - - run: ${{ platform.activate }} && python scripts/tectonic_cache.py - name: warm up tectonic cache - - - run: ${{ platform.activate }} && jlpm test - name: run frontend unit tests - - #- task: PublishTestResults@2 - # name: publish frontend test results - # inputs: - # testResultsFiles: packages/**/junit.xml - # testRunTitle: 'Jest ${{ platform.name }}${{ python.name }}' - # mergeTestResults: true - # condition: always() - - #- ${{ each js_package in parameters.js_cov_packages }}: - # - task: PublishCodeCoverageResults@1 - # name: 'publish ${{ js_package }} coverage' - # inputs: - # codeCoverageTool: Cobertura - # summaryFileLocation: 'packages/${{ js_package }}/coverage/cobertura-coverage.xml' - # condition: always() - - - run: ${{ platform.activate }} && jupyter serverextension list - name: list server extensions - - - run: ${{ platform.activate }} && python scripts/utest.py --test-run-title="Pytest ${{ platform.name }}${{ python.name }}" - name: run python tests - - - run: ${{ platform.activate }} && ${{ parameters.lab_link }} || ${{ parameters.lab_link }} || ${{ parameters.lab_link }} - name: install support packages - - - run: ${{ platform.activate }} && ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} - name: install labextensions - - - run: ${{ platform.activate }} && jupyter labextension list - name: list labextensions before build - - - run: ${{ platform.activate }} && ${{ parameters.lab_build }} || ${{ parameters.lab_build }} || ${{ parameters.lab_build }} - name: build lab - - - run: ${{ platform.activate }} && jupyter labextension list - name: list labextensions after build - - - run: ${{ platform.activate }} && python scripts/atest.py --exclude expect:fail - name: run browser tests - - #- task: PublishTestResults@2 - # name: publish browser test results - # inputs: - # testResultsFiles: atest/output/*.xunit.xml - # testRunTitle: 'Robot ${{ platform.name }}${{ python.name }}' - # mergeTestResults: true - # condition: always() - - #- task: PublishPipelineArtifact@0 - # name: publish browser test output - # inputs: - # targetPath: atest/output - # artifactName: $(Agent.JobStatus) Robot ${{ platform.name }}${{ python.name }} $(Build.BuildId) - # condition: always() + acceptance: + runs-on: ${{ matrix.os }} + name: ${{ runner.os }} ${{ matrix.python }} + defaults: + shell: bash -l {0} + steps: + - uses: actions/checkout@v2 + + - name: Set up Python and conda + uses: goanpeca/setup-miniconda@v1 + with: + python-version: ${{ matrix.python }} + conda-channels: conda-forge, anaconda + channel-priority: true + mamba-version: "*" + auto-activate-base: true + auto-update-conda: false + + - name: describe conda + shell: bash -l {0} + run: | + conda info + conda list + conda config --show-sources + conda config --show + printenv | sort + + - name: generate env with lab and node version + run: cd ./github/workflows && python env_template.py "${{ matrix.lab }}" "{{ matrix.nodejs }}" + + - name: update conda environment with test dependencies + run: conda env update -n base --file env-test.yml --quiet + + - name: install npm dependencies + run: jlpm + + - name: build typerun + run: jlpm build + + - name: build python distributions + run: python setup.py sdist bdist_wheel + + - name: build npm bundles + run: jlpm lerna run bundle + + - name: install python wheel + run: cd dist && python -m pip install jupyter_lsp-$(PY_JLSP_VERSION)-py3-none-any.whl --no-deps + + - run: python scripts/jedi_cache.py + name: warm up jedi cache + + - name: warm up tectonic cache + run: python scripts/tectonic_cache.py + + - name: run frontend unit tests + run: jlpm test + + #- task: PublishTestResults@2 + # name: publish frontend test results + # inputs: + # testResultsFiles: packages/**/junit.xml + # testRunTitle: 'Jest ${{ env.name }}${{ python.name }}' + # mergeTestResults: true + # condition: always() + + #- ${{ each js_package in parameters.js_cov_packages }}: + # - task: PublishCodeCoverageResults@1 + # name: 'publish ${{ js_package }} coverage' + # inputs: + # codeCoverageTool: Cobertura + # summaryFileLocation: 'packages/${{ js_package }}/coverage/cobertura-coverage.xml' + # condition: always() + + - name: list server extensions + run: jupyter serverextension list + + - name: run python tests + run: python scripts/utest.py --test-run-title="Pytest ${{ matrix.os }}${{ matrix.python }}" + + - name: install support packages + run: jupyter labextension link --debug --no-build $(LINKED_EXTENSIONS) + + - name: install labextensions + run: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) + + - name: list labextensions before build + run: jupyter labextension list + + - name: build lab + run: jupyter lab build --debug --dev-build=False --minimize=True + + - name: list labextensions after build + run: jupyter labextension list + + - name: run browser tests + run: python scripts/atest.py --exclude expect:fail + + #- task: PublishTestResults@2 + # name: publish browser test results + # inputs: + # testResultsFiles: atest/output/*.xunit.xml + # testRunTitle: 'Robot ${{ env.name }}${{ python.name }}' + # mergeTestResults: true + # condition: always() + + #- task: PublishPipelineArtifact@0 + # name: publish browser test output + # inputs: + # targetPath: atest/output + # artifactName: $(Agent.JobStatus) Robot ${{ env.name }}${{ python.name }} $(Build.BuildId) + # condition: always() From 71698aa70af9cd159cd6633c1a29cf970dd20b02 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:14:04 +0100 Subject: [PATCH 05/42] Add event for test, fix syntax for lint --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 31ae56976..3cda1357c 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -14,7 +14,7 @@ env: JS_JLG2D_VERSION: 1.0.0 jobs: - - Lint: + Lint: runs-on: ${{ matrix.os }} defaults: shell: bash -l {0} diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index dda5557ff..e24cfcd00 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,3 +1,5 @@ +on: [push, pull_request] + vars: js_cov_packages: - jupyterlab-go-to-definition From 7ba96d3d1b452eb17a88b1ef1341651ec12ef5bf Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:16:48 +0100 Subject: [PATCH 06/42] Strategy belongs to job, defaults can be global --- .github/workflows/job.lint.yml | 19 ++++++++++--------- .github/workflows/job.test.yml | 17 +++++++++-------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 3cda1357c..e8c0c11f2 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -1,12 +1,9 @@ name: Run acceptance tests on: [push, pull_request] -strategy: - matrix: - os: [ubuntu-16.04] - python: [3.8] - nodejs: ['>=12,<13.0.0a0'] - lap: '>=2,<3.0.0a0' +defaults: + run: + shell: bash -l {0} env: PY_JLSP_VERSION: 0.9.2 @@ -14,10 +11,14 @@ env: JS_JLG2D_VERSION: 1.0.0 jobs: - Lint: + lint: runs-on: ${{ matrix.os }} - defaults: - shell: bash -l {0} + strategy: + matrix: + os: [ubuntu-16.04] + python: [3.8] + nodejs: ['>=12,<13.0.0a0'] + lap: '>=2,<3.0.0a0' steps: - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index e24cfcd00..e6a288dd0 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -9,12 +9,9 @@ vars: lab_ext: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) lab_build: -strategy: - matrix: - python: [3.6, 3.7, 3.8] - os: [ubuntu-16.04, macos-10.14, vs2017-win2016] - nodejs: ['>=10,<11.0.0.a0', '>=2.2.0,<3.0.0a0', '>=13,<14.0.0a0'] - lab: ['>=2.2.0,<3.0.0a0'] +defaults: + run: + shell: bash -l {0} env: # TODO extract these from files instead @@ -41,8 +38,12 @@ jobs: acceptance: runs-on: ${{ matrix.os }} name: ${{ runner.os }} ${{ matrix.python }} - defaults: - shell: bash -l {0} + strategy: + matrix: + python: [3.6, 3.7, 3.8] + os: [ubuntu-16.04, macos-10.14, vs2017-win2016] + nodejs: ['>=10,<11.0.0.a0', '>=2.2.0,<3.0.0a0', '>=13,<14.0.0a0'] + lab: ['>=2.2.0,<3.0.0a0'] steps: - uses: actions/checkout@v2 From b570109ee1bfc04d32e62af1dd9a97d518e772fe Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:20:15 +0100 Subject: [PATCH 07/42] Rename workflows --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index e8c0c11f2..8c6e02932 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -1,4 +1,4 @@ -name: Run acceptance tests +name: Check lint on: [push, pull_request] defaults: diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index e6a288dd0..0abf2be3a 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,3 +1,4 @@ +name: Run acceptance tests on: [push, pull_request] vars: From 1c2700b5ece60ff76ab145b876abd9ddaa824093 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:21:59 +0100 Subject: [PATCH 08/42] Fix some syntax issues/leftovers --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 8c6e02932..b2c728491 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -18,7 +18,7 @@ jobs: os: [ubuntu-16.04] python: [3.8] nodejs: ['>=12,<13.0.0a0'] - lap: '>=2,<3.0.0a0' + lab: ['>=2,<3.0.0a0'] steps: - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 0abf2be3a..ecee202e8 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,14 +1,6 @@ name: Run acceptance tests on: [push, pull_request] -vars: - js_cov_packages: - - jupyterlab-go-to-definition - - jupyterlab-lsp - env_update: - lab_link: - lab_ext: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) - lab_build: defaults: run: @@ -86,7 +78,7 @@ jobs: run: jlpm lerna run bundle - name: install python wheel - run: cd dist && python -m pip install jupyter_lsp-$(PY_JLSP_VERSION)-py3-none-any.whl --no-deps + run: cd dist && python -m pip install jupyter_lsp-${{ env.PY_JLSP_VERSION }}-py3-none-any.whl --no-deps - run: python scripts/jedi_cache.py name: warm up jedi cache @@ -97,6 +89,10 @@ jobs: - name: run frontend unit tests run: jlpm test + # js_cov_packages: + # - jupyterlab-go-to-definition + # - jupyterlab-lsp + #- task: PublishTestResults@2 # name: publish frontend test results # inputs: From 3bdc9328d65f2859619d86fa1ddfe221309e3f7c Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:23:26 +0100 Subject: [PATCH 09/42] It's channels.. --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index b2c728491..ee5b10e73 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -24,7 +24,7 @@ jobs: uses: goanpeca/setup-miniconda@v1 with: python-version: ${{ matrix.python }} - conda-channels: conda-forge, anaconda + channels: conda-forge, anaconda channel-priority: true mamba-version: "*" auto-activate-base: true diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index ecee202e8..89aa14672 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -44,7 +44,7 @@ jobs: uses: goanpeca/setup-miniconda@v1 with: python-version: ${{ matrix.python }} - conda-channels: conda-forge, anaconda + channels: conda-forge, anaconda channel-priority: true mamba-version: "*" auto-activate-base: true From 5546f9eea63c3f689b191bfd8bd7491f518ccd0b Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:32:58 +0100 Subject: [PATCH 10/42] Try without templating env --- .github/workflows/env_template.py | 9 --------- .github/workflows/job.lint.yml | 7 ++----- .github/workflows/job.test.yml | 7 ++----- .../env-test.yml.in => requirements/github-actions.yml | 4 ---- 4 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/env_template.py rename .github/workflows/env-test.yml.in => requirements/github-actions.yml (86%) diff --git a/.github/workflows/env_template.py b/.github/workflows/env_template.py deleted file mode 100644 index 1006aa838..000000000 --- a/.github/workflows/env_template.py +++ /dev/null @@ -1,9 +0,0 @@ -from pathlib import Path -import sys - -Path("../..", "env-test.yml").write_text( - Path("env-test.yml.in").read_text().format( - lab=sys.argv[1], - nodejs=sys.argv[2] - ) -) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index ee5b10e73..5fb3c74eb 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -27,14 +27,11 @@ jobs: channels: conda-forge, anaconda channel-priority: true mamba-version: "*" - auto-activate-base: true + activate-environment: jupyterlab-lsp auto-update-conda: false - - name: generate env with lab and node version - run: cd .github/workflows && python env_template.py "${{ matrix.lab }}" "{{ matrix.nodejs }}" - - name: testing dependencies - run: conda env update -n jupyterlab-lsp --file env-test.yml --quiet + run: conda env update -n jupyterlab-lsp --file github-actions.yml jupyterlab=="${{ matrix.lab }}" nodejs=="${{ matrix.nodejs }}" - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 89aa14672..8442da28b 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -30,7 +30,7 @@ env: jobs: acceptance: runs-on: ${{ matrix.os }} - name: ${{ runner.os }} ${{ matrix.python }} + name: ${{ matrix.os }} ${{ matrix.python }} strategy: matrix: python: [3.6, 3.7, 3.8] @@ -59,11 +59,8 @@ jobs: conda config --show printenv | sort - - name: generate env with lab and node version - run: cd ./github/workflows && python env_template.py "${{ matrix.lab }}" "{{ matrix.nodejs }}" - - name: update conda environment with test dependencies - run: conda env update -n base --file env-test.yml --quiet + run: conda env update -n base --file github-actions.yml jupyterlab=="${{ matrix.lab }}" nodejs=="${{ matrix.nodejs }}" - name: install npm dependencies run: jlpm diff --git a/.github/workflows/env-test.yml.in b/requirements/github-actions.yml similarity index 86% rename from .github/workflows/env-test.yml.in rename to requirements/github-actions.yml index 930178ea7..4c394995a 100644 --- a/.github/workflows/env-test.yml.in +++ b/requirements/github-actions.yml @@ -5,10 +5,6 @@ channels: - defaults dependencies: - # runtime dependencies - - jupyterlab {lab} - # build dependencies - - nodejs {nodejs} # for python language server (and development) - flake8 >=3.5 - python-language-server From 5ee904e6b893775c98ce68dd4fad216dddffc77d Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:37:00 +0100 Subject: [PATCH 11/42] Remove incorrect == --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 5fb3c74eb..63379c476 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -31,7 +31,7 @@ jobs: auto-update-conda: false - name: testing dependencies - run: conda env update -n jupyterlab-lsp --file github-actions.yml jupyterlab=="${{ matrix.lab }}" nodejs=="${{ matrix.nodejs }}" + run: conda env update -n jupyterlab-lsp --file github-actions.yml jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 8442da28b..c674a4709 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -60,7 +60,7 @@ jobs: printenv | sort - name: update conda environment with test dependencies - run: conda env update -n base --file github-actions.yml jupyterlab=="${{ matrix.lab }}" nodejs=="${{ matrix.nodejs }}" + run: conda env update -n base --file github-actions.yml jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: install npm dependencies run: jlpm From cfa0902e2514f1ebb12597bfe098ae0446ee6335 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 00:40:40 +0100 Subject: [PATCH 12/42] Install later --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 63379c476..01381ce4c 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -31,7 +31,7 @@ jobs: auto-update-conda: false - name: testing dependencies - run: conda env update -n jupyterlab-lsp --file github-actions.yml jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" + run: conda env update -n jupyterlab-lsp --file requirements/github-actions.yml && conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index c674a4709..8661ab615 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -60,7 +60,7 @@ jobs: printenv | sort - name: update conda environment with test dependencies - run: conda env update -n base --file github-actions.yml jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" + run: conda env update -n base --file requirements/github-actions.yml && conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: install npm dependencies run: jlpm From a4e9e2bbaa420937b655f92f36ff2840904547f1 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 01:11:30 +0100 Subject: [PATCH 13/42] Split install? --- .github/workflows/job.lint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 01381ce4c..521883070 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -31,7 +31,10 @@ jobs: auto-update-conda: false - name: testing dependencies - run: conda env update -n jupyterlab-lsp --file requirements/github-actions.yml && conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" + run: conda env update -n jupyterlab-lsp --file requirements/github-actions.yml + + - name: install lab and node + run: conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet From 75ce65270272e64bf1f0657c6b5c270ae1e9d158 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 01:14:12 +0100 Subject: [PATCH 14/42] Best command is no command --- .github/workflows/job.lint.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 521883070..ceb11f8db 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -28,13 +28,11 @@ jobs: channel-priority: true mamba-version: "*" activate-environment: jupyterlab-lsp + environment-file: requirements/github-actions.yml auto-update-conda: false - - name: testing dependencies - run: conda env update -n jupyterlab-lsp --file requirements/github-actions.yml - - name: install lab and node - run: conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" + run: th conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet From aea05fb7d63b6c7f28db87e69f370c43d71847cf Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 01:24:19 +0100 Subject: [PATCH 15/42] Debug and cleanup --- .github/workflows/job.lint.yml | 15 +++++++++------ .github/workflows/job.test.yml | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index ceb11f8db..4f163af63 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -20,6 +20,9 @@ jobs: nodejs: ['>=12,<13.0.0a0'] lab: ['>=2,<3.0.0a0'] steps: + - name: ls + run: ls -la + - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 with: @@ -32,22 +35,22 @@ jobs: auto-update-conda: false - name: install lab and node - run: th conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" + run: conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet - name: check integrity of package versions - run: jupyterlab-lsp && python scripts/integrity.py + run: python scripts/integrity.py - name: install npm dependencies - run: jupyterlab-lsp && jlpm || jlpm || jlpm + run: jlpm - name: lint backend - run: jupyterlab-lsp && python scripts/lint.py + run: python scripts/lint.py - name: build schema so linting can complete - run: jupyterlab-lsp && jlpm build:schema + run: jlpm build:schema - name: lint frontend - run: jupyterlab-lsp && jlpm lint:check + run: jlpm lint:check diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 8661ab615..ae93a180f 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -35,7 +35,7 @@ jobs: matrix: python: [3.6, 3.7, 3.8] os: [ubuntu-16.04, macos-10.14, vs2017-win2016] - nodejs: ['>=10,<11.0.0.a0', '>=2.2.0,<3.0.0a0', '>=13,<14.0.0a0'] + nodejs: ['>=10,<11.0.0.a0', '>=13,<14.0.0a0'] lab: ['>=2.2.0,<3.0.0a0'] steps: - uses: actions/checkout@v2 From f3e64d851f25402a56f9c1732ba9dff1f85e9b9e Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 01:28:10 +0100 Subject: [PATCH 16/42] Checkout self --- .github/workflows/job.lint.yml | 4 ++-- .github/workflows/job.test.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 4f163af63..e9c441517 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -20,8 +20,8 @@ jobs: nodejs: ['>=12,<13.0.0a0'] lab: ['>=2,<3.0.0a0'] steps: - - name: ls - run: ls -la + - uses: actions/checkout@v2 + - uses: ./ - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index ae93a180f..0193a7480 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -39,6 +39,7 @@ jobs: lab: ['>=2.2.0,<3.0.0a0'] steps: - uses: actions/checkout@v2 + - uses: ./ - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 From 7c473f9c0b953893eacf6f5275744256fae67d73 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 01:29:13 +0100 Subject: [PATCH 17/42] Wrong uses --- .github/workflows/job.lint.yml | 1 - .github/workflows/job.test.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index e9c441517..42d2d2614 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -21,7 +21,6 @@ jobs: lab: ['>=2,<3.0.0a0'] steps: - uses: actions/checkout@v2 - - uses: ./ - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 0193a7480..ae93a180f 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -39,7 +39,6 @@ jobs: lab: ['>=2.2.0,<3.0.0a0'] steps: - uses: actions/checkout@v2 - - uses: ./ - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 From b29416fe282a7ca417ee49acba035201b8b6acba Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 01:37:26 +0100 Subject: [PATCH 18/42] Remove mamba as it fails on win --- .github/workflows/job.lint.yml | 3 +-- .github/workflows/job.test.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 42d2d2614..a05730717 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -26,9 +26,8 @@ jobs: uses: goanpeca/setup-miniconda@v1 with: python-version: ${{ matrix.python }} - channels: conda-forge, anaconda + channels: conda-forge, defaults channel-priority: true - mamba-version: "*" activate-environment: jupyterlab-lsp environment-file: requirements/github-actions.yml auto-update-conda: false diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index ae93a180f..df2cd65ae 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -44,9 +44,8 @@ jobs: uses: goanpeca/setup-miniconda@v1 with: python-version: ${{ matrix.python }} - channels: conda-forge, anaconda + channels: conda-forge, defaults channel-priority: true - mamba-version: "*" auto-activate-base: true auto-update-conda: false From 3e8276f48a78479c88da71512272f08bb60e3d1a Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 02:11:46 +0100 Subject: [PATCH 19/42] Try with substitution --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index a05730717..af23999c8 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -30,7 +30,7 @@ jobs: channel-priority: true activate-environment: jupyterlab-lsp environment-file: requirements/github-actions.yml - auto-update-conda: false + auto-update-conda: true - name: install lab and node run: conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index df2cd65ae..f4bae1331 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -40,6 +40,15 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: microsoft/variable-substitution@v1 + with: + files: 'requirements/github-actions.yml' + env: + dependencies.jupyterlab: "${{ matrix.lab }}" + dependencies.nodejs: "${{ matrix.nodejs }}" + + - run: cat requirements/github-actions.yml + - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 with: @@ -47,7 +56,9 @@ jobs: channels: conda-forge, defaults channel-priority: true auto-activate-base: true - auto-update-conda: false + activate-environment: jupyterlab-lsp + environment-file: requirements/github-actions.yml + auto-update-conda: true - name: describe conda shell: bash -l {0} @@ -58,9 +69,6 @@ jobs: conda config --show printenv | sort - - name: update conda environment with test dependencies - run: conda env update -n base --file requirements/github-actions.yml && conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - - name: install npm dependencies run: jlpm From 24d26a3effe98de016533d312ea6ad2d79523f84 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 02:22:08 +0100 Subject: [PATCH 20/42] Use envsubst-action --- .github/workflows/job.lint.yml | 11 ++++++++--- .github/workflows/job.test.yml | 9 +++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index af23999c8..2656a3366 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -22,6 +22,14 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: danielr1996/envsubst-action@1 + with: + input: 'requirements/github-actions.yml.in' + output: 'requirements/github-actions.yml' + env: + jupyterlab: "${{ matrix.lab }}" + nodejs: "${{ matrix.nodejs }}" + - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 with: @@ -32,9 +40,6 @@ jobs: environment-file: requirements/github-actions.yml auto-update-conda: true - - name: install lab and node - run: conda install jupyterlab"${{ matrix.lab }}" nodejs"${{ matrix.nodejs }}" - - name: linting dependencies run: conda env update -n jupyterlab-lsp --file requirements/lint.yml --quiet diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index f4bae1331..3ba740249 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -40,12 +40,13 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: microsoft/variable-substitution@v1 + - uses: danielr1996/envsubst-action@1 with: - files: 'requirements/github-actions.yml' + input: 'requirements/github-actions.yml.in' + output: 'requirements/github-actions.yml' env: - dependencies.jupyterlab: "${{ matrix.lab }}" - dependencies.nodejs: "${{ matrix.nodejs }}" + jupyterlab: "${{ matrix.lab }}" + nodejs: "${{ matrix.nodejs }}" - run: cat requirements/github-actions.yml From 3ddfb8999b1d23f84c9b28955b9cd7d354f1cbb1 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 02:24:38 +0100 Subject: [PATCH 21/42] Correct version, rename file --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 2 +- requirements/{github-actions.yml => github-actions.yml.in} | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) rename requirements/{github-actions.yml => github-actions.yml.in} (90%) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 2656a3366..4a7442b95 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: danielr1996/envsubst-action@1 + - uses: danielr1996/envsubst-action@1.0.0 with: input: 'requirements/github-actions.yml.in' output: 'requirements/github-actions.yml' diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 3ba740249..59ea3cbc5 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -40,7 +40,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: danielr1996/envsubst-action@1 + - uses: danielr1996/envsubst-action@1.0.0 with: input: 'requirements/github-actions.yml.in' output: 'requirements/github-actions.yml' diff --git a/requirements/github-actions.yml b/requirements/github-actions.yml.in similarity index 90% rename from requirements/github-actions.yml rename to requirements/github-actions.yml.in index 4c394995a..309a3cd42 100644 --- a/requirements/github-actions.yml +++ b/requirements/github-actions.yml.in @@ -5,6 +5,9 @@ channels: - defaults dependencies: + - jupyterlab {lab} + # build dependencies + - nodejs {nodejs} # for python language server (and development) - flake8 >=3.5 - python-language-server From d79a817a4906b289695f11f30c6cffb2d53f24cd Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 02:27:13 +0100 Subject: [PATCH 22/42] Correct to lab --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 4a7442b95..3ed776f4e 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -27,7 +27,7 @@ jobs: input: 'requirements/github-actions.yml.in' output: 'requirements/github-actions.yml' env: - jupyterlab: "${{ matrix.lab }}" + lab: "${{ matrix.lab }}" nodejs: "${{ matrix.nodejs }}" - name: Set up Python and conda diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 59ea3cbc5..f937b9f29 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -45,7 +45,7 @@ jobs: input: 'requirements/github-actions.yml.in' output: 'requirements/github-actions.yml' env: - jupyterlab: "${{ matrix.lab }}" + lab: "${{ matrix.lab }}" nodejs: "${{ matrix.nodejs }}" - run: cat requirements/github-actions.yml From d9c44f55cd74939823b32398c4b9b54ea39903e6 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 02:34:14 +0100 Subject: [PATCH 23/42] Try with cschleiden/replace-tokens --- .github/workflows/job.lint.yml | 7 ++++--- .github/workflows/job.test.yml | 7 ++++--- requirements/{github-actions.yml.in => github-actions.yml} | 0 3 files changed, 8 insertions(+), 6 deletions(-) rename requirements/{github-actions.yml.in => github-actions.yml} (100%) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 3ed776f4e..0bb1a3968 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -22,10 +22,11 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: danielr1996/envsubst-action@1.0.0 + - uses: cschleiden/replace-tokens@v1 with: - input: 'requirements/github-actions.yml.in' - output: 'requirements/github-actions.yml' + tokenPrefix: '{' + tokenSuffix: '}' + files: '["requirements/github-actions.yml"]' env: lab: "${{ matrix.lab }}" nodejs: "${{ matrix.nodejs }}" diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index f937b9f29..ddaeabbf5 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -40,10 +40,11 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: danielr1996/envsubst-action@1.0.0 + - uses: cschleiden/replace-tokens@v1 with: - input: 'requirements/github-actions.yml.in' - output: 'requirements/github-actions.yml' + tokenPrefix: '{' + tokenSuffix: '}' + files: '["requirements/github-actions.yml"]' env: lab: "${{ matrix.lab }}" nodejs: "${{ matrix.nodejs }}" diff --git a/requirements/github-actions.yml.in b/requirements/github-actions.yml similarity index 100% rename from requirements/github-actions.yml.in rename to requirements/github-actions.yml From 832420e721a9e8f5186682439d34ff1c262ea6f0 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 02:50:32 +0100 Subject: [PATCH 24/42] Update integrity test, clean up --- .github/workflows/job.lint.yml | 5 ----- .github/workflows/job.test.yml | 41 +++++++++++++++++----------------- docs/Releasing.ipynb | 4 ++-- scripts/integrity.py | 4 ++-- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 0bb1a3968..b20c99943 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -5,11 +5,6 @@ defaults: run: shell: bash -l {0} -env: - PY_JLSP_VERSION: 0.9.2 - JS_JLLSP_VERSION: 2.0.2 - JS_JLG2D_VERSION: 1.0.0 - jobs: lint: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index ddaeabbf5..f4812d010 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -40,7 +40,8 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: cschleiden/replace-tokens@v1 + - name: Set JupyterLab and Node versions + uses: cschleiden/replace-tokens@v1 with: tokenPrefix: '{' tokenSuffix: '}' @@ -49,8 +50,6 @@ jobs: lab: "${{ matrix.lab }}" nodejs: "${{ matrix.nodejs }}" - - run: cat requirements/github-actions.yml - - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 with: @@ -62,7 +61,7 @@ jobs: environment-file: requirements/github-actions.yml auto-update-conda: true - - name: describe conda + - name: Describe conda shell: bash -l {0} run: | conda info @@ -71,28 +70,28 @@ jobs: conda config --show printenv | sort - - name: install npm dependencies + - name: Install npm dependencies run: jlpm - - name: build typerun + - name: Build the extension run: jlpm build - - name: build python distributions + - name: Build python distributions run: python setup.py sdist bdist_wheel - - name: build npm bundles + - name: Build npm bundles run: jlpm lerna run bundle - - name: install python wheel + - name: Install python wheel run: cd dist && python -m pip install jupyter_lsp-${{ env.PY_JLSP_VERSION }}-py3-none-any.whl --no-deps - - run: python scripts/jedi_cache.py - name: warm up jedi cache + - name: Warm up jedi cache + run: python scripts/jedi_cache.py - - name: warm up tectonic cache + - name: Warm up tectonic cache run: python scripts/tectonic_cache.py - - name: run frontend unit tests + - name: Run frontend unit tests run: jlpm test # js_cov_packages: @@ -115,28 +114,28 @@ jobs: # summaryFileLocation: 'packages/${{ js_package }}/coverage/cobertura-coverage.xml' # condition: always() - - name: list server extensions + - name: List server extensions run: jupyter serverextension list - - name: run python tests + - name: Run python tests run: python scripts/utest.py --test-run-title="Pytest ${{ matrix.os }}${{ matrix.python }}" - - name: install support packages + - name: Install support packages run: jupyter labextension link --debug --no-build $(LINKED_EXTENSIONS) - - name: install labextensions + - name: Install labextensions run: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) - - name: list labextensions before build + - name: List labextensions before build run: jupyter labextension list - - name: build lab + - name: Build lab run: jupyter lab build --debug --dev-build=False --minimize=True - - name: list labextensions after build + - name: List labextensions after build run: jupyter labextension list - - name: run browser tests + - name: Run browser tests run: python scripts/atest.py --exclude expect:fail #- task: PublishTestResults@2 diff --git a/docs/Releasing.ipynb b/docs/Releasing.ipynb index 539ccb001..ed0b50dd6 100644 --- a/docs/Releasing.ipynb +++ b/docs/Releasing.ipynb @@ -34,13 +34,13 @@ "The PyPI version (jupyter-lsp) must be updated in the following places:\n", "\n", "- `py_src/jupyter_lsp/_version.py` (canonical)\n", - "- `azure-pipelines.yml`\n", + "- `.github/workflows/job.test.yml`\n", "- `CHANGELOG.md`\n", "\n", "The npm version of `jupyterlab-lsp` must be updated in the following places:\n", "\n", "- `packages/jupyterlab-lsp/package.json` > `version` (canonical)\n", - "- `azure-pipelines.yml`\n", + "- `.github/workflows/job.test.yml`\n", "- `packages/metapackage/package.json`\n", "- `CHANGELOG.md`\n", "\n", diff --git a/scripts/integrity.py b/scripts/integrity.py index 62cd9bb7e..1c5df7cb9 100644 --- a/scripts/integrity.py +++ b/scripts/integrity.py @@ -62,9 +62,9 @@ # CI stuff -PIPE_FILE = ROOT / "azure-pipelines.yml" +PIPE_FILE = ROOT / ".github/workflows/job.test.yml" PIPELINES = yaml.safe_load(PIPE_FILE.read_text()) -PIPE_VARS = PIPELINES["variables"] +PIPE_VARS = PIPELINES["env"] DOCS = ROOT / "docs" CI = ROOT / "ci" From 67f437fa9da6a1883de3b62bc970efab06763261 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 11:25:32 +0100 Subject: [PATCH 25/42] Try with GitHub reporters --- .github/workflows/job.test.yml | 5 ++++- docs/Releasing.ipynb | 2 +- package.json | 1 + packages/jupyterlab-lsp/jest.config.js | 8 ++++++-- scripts/integrity.py | 2 +- yarn.lock | 18 +++++++++++++++--- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index f4812d010..6010465fd 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -61,6 +61,9 @@ jobs: environment-file: requirements/github-actions.yml auto-update-conda: true + - name: Install pip dependencies + run: pip install pytest-github-actions-annotate-failures + - name: Describe conda shell: bash -l {0} run: | @@ -118,7 +121,7 @@ jobs: run: jupyter serverextension list - name: Run python tests - run: python scripts/utest.py --test-run-title="Pytest ${{ matrix.os }}${{ matrix.python }}" + run: python scripts/utest.py - name: Install support packages run: jupyter labextension link --debug --no-build $(LINKED_EXTENSIONS) diff --git a/docs/Releasing.ipynb b/docs/Releasing.ipynb index ed0b50dd6..965a5fb4d 100644 --- a/docs/Releasing.ipynb +++ b/docs/Releasing.ipynb @@ -57,7 +57,7 @@ " `@jupyterlab/application` (canonical)\n", "- `binder/environment.yml`\n", "- `requirements/lab.txt`\n", - "- `ci/job.test.yml`\n", + "- `.github/workflows/job.test.yml`\n", "- `README.md`\n", "\n", "### Releasing:\n", diff --git a/package.json b/package.json index f889e282d..fb9534ca0 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "eslint-plugin-react": "^7.19.0", "husky": "^3.0.9", "javascript-typescript-langserver": "^2.11.3", + "jest-github-actions-reporter": "^1.0.2", "lerna": "^3.13.2", "precise-commits": "^1.0.2", "prettier": "^2.0.5", diff --git a/packages/jupyterlab-lsp/jest.config.js b/packages/jupyterlab-lsp/jest.config.js index 63b50d5ac..eb6e02d50 100644 --- a/packages/jupyterlab-lsp/jest.config.js +++ b/packages/jupyterlab-lsp/jest.config.js @@ -4,7 +4,6 @@ const upstream = func('jupyterlab-lsp', __dirname); const reuseFromUpstream = [ 'moduleFileExtensions', 'moduleNameMapper', - 'reporters', 'setupFiles', 'setupFilesAfterEnv', 'testPathIgnorePatterns' @@ -18,7 +17,12 @@ let local = { '\\.(js|jsx)?$': './transform.js', '\\.svg$': 'jest-raw-loader' }, - transformIgnorePatterns: ['/node_modules/(?!(@jupyterlab/.*)/)'] + transformIgnorePatterns: ['/node_modules/(?!(@jupyterlab/.*)/)'], + testLocationInResults: true, + reporters: [ + ...upstream['reporters'], + 'jest-github-actions-reporter' + ] }; for (const option of reuseFromUpstream) { diff --git a/scripts/integrity.py b/scripts/integrity.py index 1c5df7cb9..c4c82904f 100644 --- a/scripts/integrity.py +++ b/scripts/integrity.py @@ -67,7 +67,7 @@ PIPE_VARS = PIPELINES["env"] DOCS = ROOT / "docs" -CI = ROOT / "ci" +CI = ROOT / ".github/workflows" PYTEST_INI = """ [pytest] diff --git a/yarn.lock b/yarn.lock index df217316e..27b5e90bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@actions/core@^1.2.0": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.5.tgz#fa57bf8c07a38191e243beb9ea9d8368c1cb02c8" + integrity sha512-mwpoNjHSWWh0IiALdDEQi3tru124JKn0yVNziIBzTME8QRv7thwoghVuT1jBRjFvdtoHsqD58IRHy1nf86paRg== + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" @@ -1941,14 +1946,14 @@ version "2.0.0" "@krassowski/jupyterlab-lsp@file:packages/jupyterlab-lsp": - version "1.1.2" + version "2.0.2" dependencies: "@krassowski/completion-theme" "~2.0.0" "@krassowski/jupyterlab_go_to_definition" "~1.0.0" "@krassowski/theme-material" "~2.0.0" "@krassowski/theme-vscode" "~2.0.0" lodash.mergewith "^4.6.1" - lsp-ws-connection "~0.5.0" + lsp-ws-connection "~0.5.1" "@krassowski/jupyterlab_go_to_definition@file:packages/jupyterlab-go-to-definition": version "1.0.0" @@ -8443,6 +8448,13 @@ jest-get-type@^26.3.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== +jest-github-actions-reporter@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jest-github-actions-reporter/-/jest-github-actions-reporter-1.0.2.tgz#218222b34dacdea0d9d83a2e2a2561136d25e252" + integrity sha512-iA8PfVL0cZYLJgPKc6K54nF8Y5PMo0vtONpi03H9I4dMPQtrrWaqXUX21dZRssIo7eGuEmhBcDrnwezRgkn+Rw== + dependencies: + "@actions/core" "^1.2.0" + jest-haste-map@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" @@ -9906,7 +9918,7 @@ lru-queue@0.1: es5-ext "~0.10.2" "lsp-ws-connection@file:packages/lsp-ws-connection": - version "0.5.0" + version "0.5.1" dependencies: vscode-jsonrpc "^4.1.0-next" vscode-languageclient "^5.2.1" From 00f348ee6c5b39e198821fa67bc52fc61119e8ef Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 11:58:25 +0100 Subject: [PATCH 26/42] Fix variables, lint --- .github/workflows/job.lint.yml | 4 ++-- .github/workflows/job.test.yml | 11 ++++------- packages/jupyterlab-lsp/jest.config.js | 5 +---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index b20c99943..798b634bd 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -23,8 +23,8 @@ jobs: tokenSuffix: '}' files: '["requirements/github-actions.yml"]' env: - lab: "${{ matrix.lab }}" - nodejs: "${{ matrix.nodejs }}" + lab: '${{ matrix.lab }}' + nodejs: '${{ matrix.nodejs }}' - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 6010465fd..6f90fb76d 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,7 +1,6 @@ name: Run acceptance tests on: [push, pull_request] - defaults: run: shell: bash -l {0} @@ -47,8 +46,8 @@ jobs: tokenSuffix: '}' files: '["requirements/github-actions.yml"]' env: - lab: "${{ matrix.lab }}" - nodejs: "${{ matrix.nodejs }}" + lab: '${{ matrix.lab }}' + nodejs: '${{ matrix.nodejs }}' - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 @@ -124,10 +123,10 @@ jobs: run: python scripts/utest.py - name: Install support packages - run: jupyter labextension link --debug --no-build $(LINKED_EXTENSIONS) + run: jupyter labextension link --debug --no-build ${{ LINKED_EXTENSIONS }} - name: Install labextensions - run: jupyter labextension install --debug --no-build $(FIRST_PARTY_LABEXTENSIONS) + run: jupyter labextension install --debug --no-build ${{ FIRST_PARTY_LABEXTENSIONS }} - name: List labextensions before build run: jupyter labextension list @@ -140,7 +139,6 @@ jobs: - name: Run browser tests run: python scripts/atest.py --exclude expect:fail - #- task: PublishTestResults@2 # name: publish browser test results # inputs: @@ -148,7 +146,6 @@ jobs: # testRunTitle: 'Robot ${{ env.name }}${{ python.name }}' # mergeTestResults: true # condition: always() - #- task: PublishPipelineArtifact@0 # name: publish browser test output # inputs: diff --git a/packages/jupyterlab-lsp/jest.config.js b/packages/jupyterlab-lsp/jest.config.js index eb6e02d50..58889e281 100644 --- a/packages/jupyterlab-lsp/jest.config.js +++ b/packages/jupyterlab-lsp/jest.config.js @@ -19,10 +19,7 @@ let local = { }, transformIgnorePatterns: ['/node_modules/(?!(@jupyterlab/.*)/)'], testLocationInResults: true, - reporters: [ - ...upstream['reporters'], - 'jest-github-actions-reporter' - ] + reporters: [...upstream['reporters'], 'jest-github-actions-reporter'] }; for (const option of reuseFromUpstream) { From e4a63cad41ddaa95d05a41b968818594c71346cd Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 12:01:54 +0100 Subject: [PATCH 27/42] The vars are from env --- .github/workflows/job.test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 6f90fb76d..198e71920 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -123,10 +123,10 @@ jobs: run: python scripts/utest.py - name: Install support packages - run: jupyter labextension link --debug --no-build ${{ LINKED_EXTENSIONS }} + run: jupyter labextension link --debug --no-build ${{ env.LINKED_EXTENSIONS }} - name: Install labextensions - run: jupyter labextension install --debug --no-build ${{ FIRST_PARTY_LABEXTENSIONS }} + run: jupyter labextension install --debug --no-build ${{ env.FIRST_PARTY_LABEXTENSIONS }} - name: List labextensions before build run: jupyter labextension list From cc42bc274196d0dbd0c320d6ad89a86aebbb5ac1 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 12:39:19 +0100 Subject: [PATCH 28/42] Add node in name, fix version substitution --- .github/workflows/job.test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 198e71920..15f5815e4 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -16,9 +16,6 @@ env: # TODO # YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn - FIRST_PARTY_LABEXTENSIONS: >- - packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz - LINKED_EXTENSIONS: >- packages/lsp-ws-connection packages/jupyterlab-go-to-definition @@ -29,7 +26,7 @@ env: jobs: acceptance: runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} ${{ matrix.python }} + name: ${{ matrix.os }}, Python ${{ matrix.python }}, Node ${{ matrix.nodejs }} strategy: matrix: python: [3.6, 3.7, 3.8] @@ -126,7 +123,7 @@ jobs: run: jupyter labextension link --debug --no-build ${{ env.LINKED_EXTENSIONS }} - name: Install labextensions - run: jupyter labextension install --debug --no-build ${{ env.FIRST_PARTY_LABEXTENSIONS }} + run: jupyter labextension install --debug --no-build packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-${{ env.JS_JLLSP_VERSION }}.tgz - name: List labextensions before build run: jupyter labextension list From 7f96f63d7ac0455f780bb5bdf4a59ee9d0d7f64c Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 22:21:21 +0100 Subject: [PATCH 29/42] Shorten name --- .github/workflows/job.test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 15f5815e4..31b1ee14b 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,4 +1,4 @@ -name: Run acceptance tests +name: Acceptance tests on: [push, pull_request] defaults: From 31ca31440d0f7273c7d464478391474dd2cabd14 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sat, 5 Sep 2020 13:01:23 -0400 Subject: [PATCH 30/42] add bs4 to attempt windows utf-8 reading --- atest/Keywords.robot | 11 +++++------ atest/logcheck.py | 24 ++++++++++++++++++++++++ requirements/atest.txt | 3 ++- requirements/github-actions.yml | 3 ++- 4 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 atest/logcheck.py diff --git a/atest/Keywords.robot b/atest/Keywords.robot index 0f7995ccf..3b8efebb5 100644 --- a/atest/Keywords.robot +++ b/atest/Keywords.robot @@ -4,6 +4,7 @@ Library SeleniumLibrary Library OperatingSystem Library Process Library String +Library ./logcheck.py Library ./ports.py *** Keywords *** @@ -70,12 +71,10 @@ Tear Down Everything Terminate All Processes kill=${True} Lab Log Should Not Contain Known Error Messages - ${log} = Get File ${LAB LOG} - ${test log} = Set Variable ${log[${PREVIOUS LAB LOG LENGTH}:]} - ${length} = Get Length ${log} - Set Global Variable ${PREVIOUS LAB LOG LENGTH} ${length} - Run Keyword If ("${OS}", "${PY}") !\= ("Windows", "36") - ... Should Not Contain Any ${test log} @{KNOWN BAD ERRORS} + Touch ${LAB LOG} + ${length} = Get File Size ${LAB LOG} + File Should Not Contain Phrases ${LAB LOG} ${PREVIOUS LAB LOG LENGTH} @{KNOWN BAD ERRORS} + [Teardown] Set Global Variable ${PREVIOUS LAB LOG LENGTH} ${length} Wait For Splash Go To ${URL}lab?reset&token=${TOKEN} diff --git a/atest/logcheck.py b/atest/logcheck.py new file mode 100644 index 000000000..abe44553c --- /dev/null +++ b/atest/logcheck.py @@ -0,0 +1,24 @@ +import os + +from bs4 import UnicodeDammit + + +def file_should_not_contain_phrases(filename, offset=0, *phrases): + """don't fail _too_ hard if the file can't be read for soem reason""" + with open(filename, "rb") as fp: + raw = fp.read()[offset:] + + text = None + + try: + text = raw.decode("utf-8") + except Exception as err: + text = UnicodeDammit.detwingle(raw).decode("utf-8") + + matches = {} + + for phrase in phrases: + if phrase in text: + matches[phrase] = True + + assert not matches, "Phrases found in {}: {}".format(filename, matches) diff --git a/requirements/atest.txt b/requirements/atest.txt index ed164ae82..ede3c2a6e 100644 --- a/requirements/atest.txt +++ b/requirements/atest.txt @@ -1,4 +1,5 @@ # acceptance test dependencies for jupyter_lsp -r ./lab.txt -robotframework-seleniumlibrary +bs4 robotframework >=3.2 +robotframework-seleniumlibrary diff --git a/requirements/github-actions.yml b/requirements/github-actions.yml index 309a3cd42..cbc101f40 100644 --- a/requirements/github-actions.yml +++ b/requirements/github-actions.yml @@ -30,7 +30,8 @@ dependencies: - pytest-runner - ruamel_yaml # browser testing + - bs4 - firefox - geckodriver - - robotframework-seleniumlibrary - robotframework >=3.2 + - robotframework-seleniumlibrary From b6d2a75460e3ebf31c059aec5e896a544d16efb5 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 22:28:49 +0100 Subject: [PATCH 31/42] Add yarn and conda cache for the test workflow --- .github/workflows/job.test.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 31b1ee14b..24ccadc09 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,5 +1,11 @@ name: Acceptance tests -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master defaults: run: @@ -13,8 +19,6 @@ env: PYTHONUNBUFFERED: 1 ATEST_RETRIES: 3 - # TODO - # YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn LINKED_EXTENSIONS: >- packages/lsp-ws-connection @@ -46,6 +50,15 @@ jobs: lab: '${{ matrix.lab }}' nodejs: '${{ matrix.nodejs }}' + - name: Cache conda + uses: actions/cache@v1 + env: + # Increase this value to reset cache if requirements/github-actions.yml has not changed + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: ${{ matrix.os }}-${{ matrix.python }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/github-actions.yml') }} + - name: Set up Python and conda uses: goanpeca/setup-miniconda@v1 with: @@ -56,6 +69,7 @@ jobs: activate-environment: jupyterlab-lsp environment-file: requirements/github-actions.yml auto-update-conda: true + use-only-tar-bz2: true # needs to be set for caching to work properly - name: Install pip dependencies run: pip install pytest-github-actions-annotate-failures @@ -69,6 +83,15 @@ jobs: conda config --show printenv | sort + - name: Cache yarn + uses: actions/cache@v1 + with: + path: .yarn-packages + key: yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }} + restore-keys: | + yarn-${{ runner.os }}- + yarn- + - name: Install npm dependencies run: jlpm From bb19f8cd08a9049b43c78ae4fca5f22f5da18734 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 8 Sep 2020 08:49:58 -0400 Subject: [PATCH 32/42] fix typo --- atest/logcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atest/logcheck.py b/atest/logcheck.py index abe44553c..910d50410 100644 --- a/atest/logcheck.py +++ b/atest/logcheck.py @@ -4,7 +4,7 @@ def file_should_not_contain_phrases(filename, offset=0, *phrases): - """don't fail _too_ hard if the file can't be read for soem reason""" + """don't fail _too_ hard if the file can't be read for some reason""" with open(filename, "rb") as fp: raw = fp.read()[offset:] From 2ecd1b7dbfdf6cb4b4cce476992a92bb110fa28a Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 8 Sep 2020 09:14:40 -0400 Subject: [PATCH 33/42] linting --- atest/logcheck.py | 18 +++++++++++------- package.json | 2 +- scripts/lint.py | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/atest/logcheck.py b/atest/logcheck.py index 910d50410..978d28dee 100644 --- a/atest/logcheck.py +++ b/atest/logcheck.py @@ -1,5 +1,3 @@ -import os - from bs4 import UnicodeDammit @@ -13,12 +11,18 @@ def file_should_not_contain_phrases(filename, offset=0, *phrases): try: text = raw.decode("utf-8") except Exception as err: - text = UnicodeDammit.detwingle(raw).decode("utf-8") + print("Failed to read", filename, "forcing unicode...\n", err) + try: + text = UnicodeDammit.detwingle(raw).decode("utf-8") + except Exception as err: + print("Failed to read", filename, "giving up...\n", err) + text = None matches = {} - for phrase in phrases: - if phrase in text: - matches[phrase] = True + if text is not None: + for phrase in phrases: + if phrase in text: + matches[phrase] = True - assert not matches, "Phrases found in {}: {}".format(filename, matches) + assert not matches, "Phrases found in {}: {}".format(filename, matches) diff --git a/package.json b/package.json index fb9534ca0..85cad266b 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "lint:check": "jlpm prettier:check && jlpm eslint:check", "lint": "jlpm prettier && jlpm eslint", "prettier:check": "prettier --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"", - "prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"", + "prettier": "prettier --list-different --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"", "eslint": "eslint --config packages/.eslintrc.js --ext .js,.jsx,.ts,.tsx --fix packages", "eslint:check": "eslint --config packages/.eslintrc.js --ext .js,.jsx,.ts,.tsx packages", "test": "lerna run --stream --concurrency=1 test" diff --git a/scripts/lint.py b/scripts/lint.py index ced814fee..8de26d26c 100644 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -60,7 +60,7 @@ def lint(): ["mypy", *PY_SRC], ["python", "-m", "robot.tidy", "--inplace", *ALL_ROBOT], ["rflint", *RFLINT, *ALL_ROBOT], - ["python", "scripts/atest.py", "--dryrun", "--console", "quiet"], + ["python", "scripts/atest.py", "--dryrun", "--console", "dotted"], ["python", "scripts/nblint.py"], ], ) From 3364e0857343004d6536fac6daa589ae5eb3bef5 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 22:43:33 +0100 Subject: [PATCH 34/42] Try to add jedi cache --- .github/workflows/job.test.yml | 9 +++++++++ scripts/jedi_cache.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 24ccadc09..df2428882 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -107,6 +107,15 @@ jobs: - name: Install python wheel run: cd dist && python -m pip install jupyter_lsp-${{ env.PY_JLSP_VERSION }}-py3-none-any.whl --no-deps + - name: Find out jedi cache location + run: python -c 'import jedi; print("::set-env name=JEDI_CACHE_DIR::" + jedi.settings.cache_directory)' + + - name: Cache jedi cache + uses: actions/cache@v1 + with: + path: ${{ env.JEDI_CACHE_DIR }} + key: jedi-${{ matrix.os }}-${{ hashFiles('scripts/jedi_cache.py') }}-${{ hashFiles('requirements/github-actions.yml') }} + - name: Warm up jedi cache run: python scripts/jedi_cache.py diff --git a/scripts/jedi_cache.py b/scripts/jedi_cache.py index 998e14963..f6c696db5 100644 --- a/scripts/jedi_cache.py +++ b/scripts/jedi_cache.py @@ -21,7 +21,7 @@ - When _using_ jedi for the first time, the cache gets created in `jedi.settings.cache_directory`, usually somewhere in $HOME. -- As different libriraries are inspected by jedi, they get +- As different libraries are inspected by jedi, they get added to the cache. - This is very slow, especially on windows, and cannot feasibly be cached, today. From bf3057627e3087cbf53948a7a6a90e0306c6c098 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 22:54:14 +0100 Subject: [PATCH 35/42] Try to reduce the job matrix (too many jobs as for our needs) --- .github/workflows/job.test.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index df2428882..040ca1018 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -35,8 +35,21 @@ jobs: matrix: python: [3.6, 3.7, 3.8] os: [ubuntu-16.04, macos-10.14, vs2017-win2016] - nodejs: ['>=10,<11.0.0.a0', '>=13,<14.0.0a0'] lab: ['>=2.2.0,<3.0.0a0'] + include: + # if using 3.6, use an old node + - python: 3.6 + # Node 10 end-of-life: April 2021 + nodejs: '>=10,<11.0.0.a0' + # if using 3.7, use newer node, etc... + - python: 3.7 + # Node 12 end-of-life: April 2022 + nodejs: '>=12,<13.0.0.a0' + - python: 3.8 + # Node 14 end-of-life: April 2023 + # TODO Node 13 is no longer supported + nodejs: '>=13,<14.0.0.a0' + steps: - uses: actions/checkout@v2 From 5265842ed674230eb66039973a0823d1d016ca97 Mon Sep 17 00:00:00 2001 From: krassowski Date: Wed, 9 Sep 2020 23:43:21 +0100 Subject: [PATCH 36/42] Try caching tectonic, rename, swap badge --- .github/workflows/job.lint.yml | 2 +- .github/workflows/job.test.yml | 12 +++++++++++- README.md | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 798b634bd..5106a9919 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -1,4 +1,4 @@ -name: Check lint +name: lint on: [push, pull_request] defaults: diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 040ca1018..0690c5b4c 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -1,4 +1,4 @@ -name: Acceptance tests +name: tests on: push: branches: @@ -132,6 +132,16 @@ jobs: - name: Warm up jedi cache run: python scripts/jedi_cache.py + - name: Cache tectonic cache + uses: actions/cache@v2 + with: + # locations for: Linux, MacOS, Windows + path: | + ~/.cache/Tectonic + ~/Library/Caches/Tectonic + %LOCALAPPDATA%/TectonicProject/Tectonic + key: ${{ runner.os }}-${{ hashFiles('scripts/tectonic_cache.py') }} + - name: Warm up tectonic cache run: python scripts/tectonic_cache.py diff --git a/README.md b/README.md index b04f19487..c812db886 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Language Server Protocol integration for Jupyter(Lab) -[![Build Status](https://travis-ci.org/krassowski/jupyterlab-lsp.svg?branch=master)](https://travis-ci.org/krassowski/jupyterlab-lsp) [![Build Status](https://dev.azure.com/krassowskimichal/jupyterlab-lsp/_apis/build/status/jupyterlab-lsp?branchName=master)](https://dev.azure.com/krassowskimichal/jupyterlab-lsp/_build/latest?definitionId=1&branchName=master) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-lsp/badge/?version=latest)](https://jupyterlab-lsp.readthedocs.io/en/latest/?badge=latest) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/krassowski/jupyterlab-lsp/master?urlpath=lab%2Ftree%2Fexamples%2FPython.ipynb) +[![Build Status](https://travis-ci.org/krassowski/jupyterlab-lsp.svg?branch=master)](https://travis-ci.org/krassowski/jupyterlab-lsp) ![tests](https://github.com/krassowski/jupyterlab-lsp/workflows/tests/badge.svg) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-lsp/badge/?version=latest)](https://jupyterlab-lsp.readthedocs.io/en/latest/?badge=latest) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/krassowski/jupyterlab-lsp/master?urlpath=lab%2Ftree%2Fexamples%2FPython.ipynb) > _This project is still maturing, but you are welcome to check it out, leave feedback and/or a PR_ From 2196f05fd2869eaad418d650008ff5a0101bdd46 Mon Sep 17 00:00:00 2001 From: krassowski Date: Thu, 10 Sep 2020 00:05:04 +0100 Subject: [PATCH 37/42] Do not remove the jedi cache on warm up --- scripts/jedi_cache.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/jedi_cache.py b/scripts/jedi_cache.py index f6c696db5..cb62fd553 100644 --- a/scripts/jedi_cache.py +++ b/scripts/jedi_cache.py @@ -93,11 +93,7 @@ def setup_jedi(): print("default jedi environment", jedi.api.environment.get_default_environment()) print("jedi environment", ENV) jedi_cache = pathlib.Path(jedi.settings.cache_directory) - if jedi_cache.exists(): - shutil.rmtree(jedi_cache) - print("removed jedi cache!") - else: - print("no jedi cache was found!") + return jedi_cache.exists() def warm_up(modules): @@ -105,7 +101,12 @@ def warm_up(modules): print("-" * 80) print_versions() print("-" * 80) - setup_jedi() + cache_exists = setup_jedi() + if cache_exists: + print("jedi cache already exists, aborting warm up!") + return + else: + print("no jedi cache was found, warming up!") print("-" * 80) start = time.time() [warm_up_one(module) for module in modules] @@ -115,4 +116,4 @@ def warm_up(modules): if __name__ == "__main__": - warm_up(sorted(set(sys.argv[1:] or MODULES_TO_CACHE))) + warm_up(sorted(set(sys.argv[2:] or MODULES_TO_CACHE))) From ef1a648f492f6b1aeffe7c86074367c50fbbc4c2 Mon Sep 17 00:00:00 2001 From: krassowski Date: Thu, 10 Sep 2020 00:33:29 +0100 Subject: [PATCH 38/42] Remove unused shutil --- scripts/jedi_cache.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/jedi_cache.py b/scripts/jedi_cache.py index cb62fd553..3a779d87c 100644 --- a/scripts/jedi_cache.py +++ b/scripts/jedi_cache.py @@ -38,7 +38,6 @@ """ import os import pathlib -import shutil import sys import time From 13b825169e93ff9312ff00f941d113d7419b91db Mon Sep 17 00:00:00 2001 From: krassowski Date: Thu, 10 Sep 2020 01:25:48 +0100 Subject: [PATCH 39/42] Attempt to publish Robot artifacts --- .github/workflows/job.test.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 0690c5b4c..db2842c84 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -191,6 +191,7 @@ jobs: - name: Run browser tests run: python scripts/atest.py --exclude expect:fail + #- task: PublishTestResults@2 # name: publish browser test results # inputs: @@ -198,9 +199,10 @@ jobs: # testRunTitle: 'Robot ${{ env.name }}${{ python.name }}' # mergeTestResults: true # condition: always() - #- task: PublishPipelineArtifact@0 - # name: publish browser test output - # inputs: - # targetPath: atest/output - # artifactName: $(Agent.JobStatus) Robot ${{ env.name }}${{ python.name }} $(Build.BuildId) - # condition: always() + + - name: Publish browser test output + uses: actions/upload-artifact@v2 + with: + name: ${{ job.status }} Robot ${{ matrix.os }} Python ${{ matrix.python }} Node ${{ matrix.nodejs }} ${{ github.run_number }} + path: ./atest/output + if: always() From a8c4d90679062d2db8cb667d4ba5ebdaf4e3c38a Mon Sep 17 00:00:00 2001 From: krassowski Date: Thu, 10 Sep 2020 02:24:35 +0100 Subject: [PATCH 40/42] Remove nodejs spec from robot artifact name for now as it contains forbidden characters --- .github/workflows/job.test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index db2842c84..5a765b26e 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -203,6 +203,6 @@ jobs: - name: Publish browser test output uses: actions/upload-artifact@v2 with: - name: ${{ job.status }} Robot ${{ matrix.os }} Python ${{ matrix.python }} Node ${{ matrix.nodejs }} ${{ github.run_number }} + name: ${{ job.status }} Robot ${{ matrix.os }} Python ${{ matrix.python }} ${{ github.run_number }} path: ./atest/output if: always() From 0547ea51aba0b470205b7f3aadd151ad7269d844 Mon Sep 17 00:00:00 2001 From: krassowski Date: Thu, 10 Sep 2020 16:57:33 +0100 Subject: [PATCH 41/42] Limit lint to master too --- .github/workflows/job.lint.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job.lint.yml b/.github/workflows/job.lint.yml index 5106a9919..ed86e34fb 100644 --- a/.github/workflows/job.lint.yml +++ b/.github/workflows/job.lint.yml @@ -1,5 +1,11 @@ name: lint -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + branches: + - master defaults: run: From b45a4b91bc41c9e429a7b3454586efcaef963477 Mon Sep 17 00:00:00 2001 From: krassowski Date: Thu, 10 Sep 2020 16:57:51 +0100 Subject: [PATCH 42/42] Try to test with Node 14 instead of 13 --- .github/workflows/job.test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/job.test.yml b/.github/workflows/job.test.yml index 5a765b26e..fb0b635bb 100644 --- a/.github/workflows/job.test.yml +++ b/.github/workflows/job.test.yml @@ -47,8 +47,7 @@ jobs: nodejs: '>=12,<13.0.0.a0' - python: 3.8 # Node 14 end-of-life: April 2023 - # TODO Node 13 is no longer supported - nodejs: '>=13,<14.0.0.a0' + nodejs: '>=14,<15.0.0.a0' steps: - uses: actions/checkout@v2