This commit is contained in:
Yan Zhang 2022-06-27 14:31:37 +08:00 коммит произвёл GitHub
Родитель e170dcbdf6
Коммит ead279c574
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 61 добавлений и 21 удалений

56
.github/workflows/linux.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,56 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Setup Build Environment
run: |
sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install Node.js modules
run: npm install
- name: Install VSCE
run: npm install -g vsce
- name: Linting
run: npm run tslint
- name: Install VSCE
run: npm run compile
- name: Build OSGi bundle
run: npm run build-plugin
- name: Build VSIX file
run: vsce package
- name: Test extension
run: DISPLAY=:99 npm test
- name: Print language server Log if job failed
if: ${{ failure() }}
run: find $HOME/.config/Code/User/workspaceStorage/*/redhat.java/jdt_ws/.metadata/.log -print -exec cat '{}' \;;

Просмотреть файл

@ -1,35 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from "@vscode/test-electron";
import * as cp from "child_process";
import * as os from "os";
import * as path from "path";
import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } from "@vscode/test-electron";
async function main(): Promise<void> {
try {
const vscodeExecutablePath = await downloadAndUnzipVSCode();
let platform;
switch (os.platform()) {
case "linux":
platform = "linux-x64";
break;
case "win32":
platform = "win32-x64-archive";
break;
case "darwin":
platform = os.arch() === "arm64" ? "darwin-arm64" : "darwin"
break;
default:
console.error(`unsupported platform: ${os.platform()}`);
return;
}
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath, platform);
// Resolve extension dependencies
cp.spawnSync(cliPath, ["--install-extension", "redhat.java"], {
encoding: "utf-8",
stdio: "inherit",
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
cp.spawnSync(cli, [...args, '--install-extension', 'redhat.java'], {
encoding: 'utf-8',
stdio: 'inherit'
});
// The folder containing the Extension Manifest package.json