diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml deleted file mode 100644 index 7067394cf..000000000 --- a/.github/workflows/beta.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Beta - -on: - push: - branches: - - beta - -jobs: - # Simple job the checks to see which parts we actually have to build. - trigger: - name: Trigger - runs-on: ubuntu-latest - outputs: - vscode: ${{steps.check-vscode.outputs.build}} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - run: | - if [ -z "${BASE_REF}" ]; then - echo "BASE=HEAD^" >> $GITHUB_ENV - else - echo "BASE=origin/${BASE_REF}" >> $GITHUB_ENV - fi - name: Determine base - env: - BASE_REF: ${{ github.base_ref }} - - - run: | - set -e - echo ${BASE} - ./scripts/should-build.sh vscode - id: check-vscode - name: "Build VSCode?" - - vscode: - name: VSCode Extension - needs: [trigger] - if: needs.trigger.outputs.vscode - runs-on: ubuntu-latest - steps: - - uses: 'actions/checkout@v4' - - - uses: actions/setup-node@v3 - with: - node-version: '16.x' - cache: 'npm' - cache-dependency-path: 'code/package-lock.json' - - # This must be set to the minimum Python version we support - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - - name: Pip cache - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-vscode-pip-deps-${{ hashFiles('code/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-vscode-pip-deps - - - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade bump2version towncrier docutils - name: Install Build Tools - - - run: | - set -e - ./scripts/make-release.sh vscode - id: info - name: Set Version - - - run: | - cd code - npm ci --prefer-offline - make bundle-deps - name: Install Dependencies - - - run: | - cd code - npm run package - name: Package Extension - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: 'vsix' - path: code/*.vsix - if-no-files-found: error - retention-days: 7 diff --git a/.github/workflows/vscode-pr.yml b/.github/workflows/vscode-pr.yml index beabdec5a..cfb33265f 100644 --- a/.github/workflows/vscode-pr.yml +++ b/.github/workflows/vscode-pr.yml @@ -1,4 +1,4 @@ -name: VSCode PR +name: 'PR: vscode' on: pull_request: branches: @@ -6,9 +6,9 @@ on: - release paths: - 'code/**' + jobs: vscode: - name: Test Extension runs-on: ubuntu-latest steps: - uses: 'actions/checkout@v4' @@ -16,41 +16,49 @@ jobs: - uses: 'actions/setup-node@v3' with: node-version: 16.x + cache: 'npm' + cache-dependency-path: 'code/package-lock.json' - uses: 'actions/setup-python@v4' with: - python-version: "3.10" + # This must be the minimum Python version we support + python-version: "3.8" + + - name: Pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-vscode-pip-deps-${{ hashFiles('code/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-vscode-pip-deps - run: | python --version python -m pip install --upgrade pip - python -m pip install --upgrade bump2version - + python -m pip install --upgrade bump2version tox name: Install Build Tools - run: | set -e - - # Despite the script's name, this is only used to obtain a - # dev version number e.g. v1.2.3-dev4 - ./scripts/make-release.sh vscode - name: Set Version + cd lib/esbonio + tox run -e pkg + echo "ESBONIO_WHL=$(find $(pwd)/dist -name '*.whl')" >> $GITHUB_ENV + name: Package Language Server - run: | set -e - - cd code - npm ci - - mkdir dist - npm test - name: Test Extension + ./scripts/make-release.sh vscode + name: Set Versions - run: | set -e + echo "whl=${ESBONIO_WHL}" + cd code - rm -r dist + ESBONIO_WHL=${ESBONIO_WHL} tox run -e bundle-deps + + npm ci --prefer-offline npm run package id: assets name: Package Extension @@ -60,3 +68,5 @@ jobs: with: name: 'vsix' path: code/*.vsix + if-no-files-found: error + retention-days: 7 diff --git a/code/.vscodeignore b/code/.vscodeignore index bc435d353..81640c7d2 100644 --- a/code/.vscodeignore +++ b/code/.vscodeignore @@ -1,4 +1,5 @@ .bumpversion.cfg +.tox .pytest_cache **/__pycache__/** **/.pyc