Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 47 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,39 @@ jobs:
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
artifact_name: squawk-linux-x64
vscode_artifact_name: linux-x64

- name: Linux arm64
os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
artifact_name: squawk-linux-arm64
vscode_artifact_name: linux-arm64
rustflags: "-C linker=aarch64-linux-gnu-gcc"

- name: Linux Alpine x86_64
os: ubuntu-22.04
target: x86_64-unknown-linux-musl
artifact_name: squawk-linux-musl-x64
vscode_artifact_name: alpine-x64
rustflags: "-C linker=rust-lld"

- name: Windows x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: squawk-windows-x64.exe
vscode_artifact_name: win32-x64

- name: macOS x86_64
os: macos-latest
target: x86_64-apple-darwin
artifact_name: squawk-darwin-x64
vscode_artifact_name: darwin-x64

- name: macOS arm64
os: macos-latest
target: aarch64-apple-darwin
artifact_name: squawk-darwin-arm64
vscode_artifact_name: darwin-arm64

name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -106,12 +112,53 @@ jobs:
name: release-${{ matrix.artifact_name }}
path: target/release/${{ matrix.artifact_name }}

- name: VSCode - Make server dir
shell: bash
run: mkdir squawk-vscode/server

- name: VSCode - Copy binary into extension (windows)
if: matrix.target == 'x86_64-pc-windows-msvc'
shell: bash
run: cp target/release/${{ matrix.artifact_name }} squawk-vscode/server/squawk.exe

- name: VSCode - Copy binary into extension (linux, mac)
if: matrix.target != 'x86_64-pc-windows-msvc'
shell: bash
run: cp target/release/${{ matrix.artifact_name }} squawk-vscode/server/squawk

- name: VSCode - Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: VSCode - Setup node
uses: actions/setup-node@v3
with:
node-version-file: "squawk-vscode/package.json"
cache-dependency-path: "squawk-vscode/pnpm-lock.yaml"
cache: "pnpm"

- name: VSCode - Install JS dependencies
working-directory: "squawk-vscode"
run: pnpm install

- name: VSCode - Build
working-directory: "squawk-vscode"
run: pnpm exec vsce pack --no-dependencies --target ${{ matrix.vscode_artifact_name }}

- name: VSCode - Artifact
uses: actions/upload-artifact@v4
with:
name: squawk-vscode-${{ matrix.vscode_artifact_name }}
path: squawk-vscode/*.vsix

- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # pin@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/${{ matrix.artifact_name }}
squawk-vscode/*.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion s/lint
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -e

if [[ "$CI" ]]; then
if [ -z "$CI" ]; then
cargo fmt -- --check
cargo clippy --all-targets --all-features -- -D warnings
else
Expand Down
2 changes: 1 addition & 1 deletion s/prettier
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex

main() {
if [ "$CI" ]; then
if [ -z "$CI" ]; then
./node_modules/.bin/prettier --check '**/*.{js,md,yml,json}'
else
./node_modules/.bin/prettier '**/*.{js,md,yml,json}' --write
Expand Down
4 changes: 4 additions & 0 deletions squawk-vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode-test
out
*.vsix
server/
1 change: 1 addition & 0 deletions squawk-vscode/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
13 changes: 13 additions & 0 deletions squawk-vscode/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build/
node_modules/
playground/
coverage/
extension/
dist/
out/
.venv/
.mypy_cache/
.terraform/
.pytest_cache/
target/
docs
5 changes: 5 additions & 0 deletions squawk-vscode/.vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from "@vscode/test-cli"

export default defineConfig({
files: "out/test/**/*.test.js",
})
9 changes: 9 additions & 0 deletions squawk-vscode/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner"
]
}
17 changes: 17 additions & 0 deletions squawk-vscode/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
13 changes: 13 additions & 0 deletions squawk-vscode/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
58 changes: 58 additions & 0 deletions squawk-vscode/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": ["npm: watch:tsc", "npm: watch:esbuild"],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
}
16 changes: 16 additions & 0 deletions squawk-vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**
.gitignore
.yarnrc
esbuild.js
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/prettier.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*
s
Loading
Loading