Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
scripts
*.d.ts
68 changes: 46 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
name: main
on: [push, pull_request]
env:
SCRIPT_DIR: ./.github/scripts
on:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
node-version: 18
use-public-rspm: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm install
- name: Install remotes
run: install.packages("remotes")
shell: Rscript {0}
- run: npm run build
- name: Run tests
uses: GabrielBB/xvfb-action@v1.0
with:
Expand All @@ -24,41 +41,48 @@ jobs:
env:
VSIX_FILE: vscode-R.vsix
steps:
- uses: actions/checkout@v3
- run: npm install
- uses: lannonbr/vsce-action@4.0.0
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
args: "package -o $VSIX_FILE"
node-version: 20
cache: 'npm'
- run: npm install
- name: Package extension
run: npx @vscode/vsce package -o $VSIX_FILE
- uses: actions/upload-artifact@v4
with:
name: ${{ env.VSIX_FILE }}
path: ${{ env.VSIX_FILE }}
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run lint
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install lintr
run: install.packages("lintr")
shell: Rscript {0}

- name: Lint root directory
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- run: npm install
- name: eslint
run: npx eslint src --ext ts

- name: Lint R directory
run: lintr::lint_dir("./R")
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true

- name: Lint root directory
run: lintr::lint_package("sess")
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
57 changes: 30 additions & 27 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,50 @@ on:

env:
FILE_OUT: r-latest.vsix
SCRIPT_DIR: ./.github/scripts
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


jobs:
build:
runs-on: ubuntu-latest
env:
VSIX_FILE: vscode-R.vsix
steps:
- uses: actions/checkout@v3
- run: npm install
- uses: lannonbr/vsce-action@4.0.0
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
args: "package -o $FILE_OUT"
node-version: 20
cache: 'npm'
- run: npm install
- name: Package extension
run: npx @vscode/vsce package -o $VSIX_FILE
- uses: actions/upload-artifact@v4
with:
name: "${{ env.FILE_OUT }}"
path: "${{ env.FILE_OUT }}"
name: "${{ env.VSIX_FILE }}"
path: "${{ env.VSIX_FILE }}"

pre-release:
name: Pre-Release
needs: build
runs-on: ubuntu-latest

env:
VSIX_FILE: vscode-R.vsix
permissions:
contents: write
steps:
- name: Update tag
uses: richardsimko/update-tag@v1
with:
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
pattern: "${{ env.VSIX_FILE }}"
path: "artifacts/"
- name: Upload artifacts
uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: latest
commitish: master
name: Development Build
body: Contains the vsix-file from the latest push to master.
prerelease: true
files: "artifacts/*/*"
gzip: false
allow_override: true
- name: Create or update pre-release
run: |
gh release delete latest --yes || true
git tag -d latest || true
git tag latest
git push origin latest --force
gh release create latest artifacts/${{ env.VSIX_FILE }}/${{ env.VSIX_FILE }} \
--title "Development Build" \
--notes "Contains the vsix-file from the latest push to master." \
--prerelease
70 changes: 38 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,68 @@ on:
tags: ["v*"]

env:
SCRIPT_DIR: ./.github/scripts
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- uses: lannonbr/vsce-action@4.0.0
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
args: "package"
- name: Identify output file # can be retrieved as steps.filenames.outputs.file_out
id: filenames
run: echo "::set-output name=file_out::$(ls | grep "^.*\.vsix$" | head -1)"
node-version: 20
cache: 'npm'
- run: npm install
- name: Package extension
id: package
run: |
npx @vscode/vsce package
echo "VSIX_FILE=$(ls *.vsix)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.filenames.outputs.file_out }}
path: ${{ steps.filenames.outputs.file_out }}
name: vsix-artifact
path: "*.vsix"

release:
name: Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
path: "artifacts/"
- name: Get version from tag
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\/v/}
name: vsix-artifact
path: artifacts/
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: "artifacts/*/*"
prerelease: false
draft: false

run: |
VERSION=${GITHUB_REF#refs/tags/v}
gh release create v$VERSION artifacts/*.vsix \
--title "v$VERSION" \
--notes "Release v$VERSION" \
--generate-notes

publish:
name: Publish
timeout-minutes: 30
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm install
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
id: publishToOpenVSX
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
name: vsix-artifact
path: artifacts/
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
run: npx @vscode/vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath artifacts/*.vsix
- name: Publish to Open VSX Registry
run: npx ovsx publish -p ${{ secrets.OPEN_VSX_TOKEN }} --packagePath artifacts/*.vsix
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ node_modules
*.vsix
dist
.vscode-test

html/**/*.js

*.temp
*.tmp
tmp.*
Expand Down
13 changes: 13 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/suite/**/*.test.js',
mocha: {
ui: 'tdd',
color: true,
timeout: 20000
},
desktop: {
installExtensions: ['REditorSupport.r-syntax']
}
});
7 changes: 5 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extension", "google.geminicodeassist"
],
"outFiles": [
"${workspaceFolder}/out/src/**/*.js"
],
"sourceMaps": true,
},
{
"name": "Launch Extension (--disable-extensions)",
Expand All @@ -28,6 +30,7 @@
"outFiles": [
"${workspaceFolder}/out/src/**/*.js"
],
"sourceMaps": true,
},
{
"name": "Extension Tests",
Expand All @@ -44,4 +47,4 @@
"preLaunchTask": "npm: pretest"
}
]
}
}
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
.vscode/**
.xls
.xlsx
cliff.toml
**/*.map
html/**/*.ts
out/test/**
src/
src/**
test/**
**/tsconfig.json
vsc-extension-quickstart.md
esbuild.js
.markdownlint.json
.eslintignore
Expand Down
Loading
Loading