Skip to content

Commit

Permalink
Add workflows for CI and publishing
Browse files Browse the repository at this point in the history
- Remove Jenkinsfile
- Update repo script to allow defining the protocol (ssh vs https)
  • Loading branch information
tortmayr committed Jul 17, 2024
1 parent 5f3092a commit 0616dc2
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 22 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
name: Playwright Tests
runs-on: ubuntu-latest
env:
CI: true
STANDALONE_URL: 'file://${{ github.workspace }}/examples/workflow-test/repositories/glsp-client/examples/workflow-standalone/app/diagram.html'
THEIA_URL: 'http://localhost:3000'
VSCODE_VSIX_ID: 'eclipse-glsp.workflow-vscode-example'
Expand All @@ -67,11 +66,14 @@ jobs:
- name: Install dependencies
run: yarn install
- name: Prepare repos
run: yarn repo prepare
run: yarn repo prepare --protocol https
- name: Start theia
run: yarn repo theia-integration start &
- name: Run Playwright tests
run: yarn test
run: xvfb-run -a yarn test:theia
continue-on-error: true
- name: Upload Playwright report
uses: actions/[email protected]
with:
name: playwright-report
path: glsp-playwright/examples/workflow-test/playwright-report/
path: examples/workflow-test/playwright-report/
3 changes: 1 addition & 2 deletions examples/workflow-test/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ const config: PlaywrightTestConfig<GLSPPlaywrightOptions> = {
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', { open: 'never' }]],
reporter: process.env.CI ? [['html', { open: 'never' }], ['@estruyf/github-actions-reporter']] : [['html', { open: 'never' }]],
use: {
actionTimeout: 0,
trace: 'on-first-retry'
Expand Down
54 changes: 38 additions & 16 deletions examples/workflow-test/scripts/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface GlobalOptions {
interface CloneOptions extends GlobalOptions {
override?: 'rename' | 'remove';
branch?: string;
protocol: 'ssh' | 'https';
}

// ========== Constants ======================================================== //
Expand Down Expand Up @@ -78,7 +79,9 @@ function clone(repository: string, options: CloneOptions): void {
}
}

exec('git', ['clone', `[email protected]:eclipse-glsp/${repository}.git`, ...branch, destination]);
const remote =
options.protocol === 'ssh' ? `[email protected]:eclipse-glsp/${repository}.git` : `https://github.com/eclipse-glsp/${repository}.git`;
exec('git', ['clone', remote, ...branch, destination]);
}

function log(repository: string, options: GlobalOptions): void {
Expand Down Expand Up @@ -124,24 +127,34 @@ async function main(): Promise<void> {
'prepare',
'Clones and builds all projects',
b =>
b.options('override', {
choices: ['rename', 'remove'],
description: 'Rename or remove if the folder already exists',
type: 'string'
} as const),
b
.options('override', {
choices: ['rename', 'remove'],
description: 'Rename or remove if the folder already exists',
type: 'string'
} as const)
.options('protocol', {
choices: ['ssh', 'https'],
description: 'Protocol to use for cloning',
type: 'string',
default: 'ssh'
} as const),
argv => {
const { folder, override } = argv;
const { folder, override, protocol } = argv;
clone(clientRepository, {
folder,
override
override,
protocol
});
clone(theiaRepository, {
folder,
override
override,
protocol
});
clone(vsCodeRepository, {
folder,
override
override,
protocol
});
buildClient(argv);
buildTheia(argv);
Expand Down Expand Up @@ -170,11 +183,12 @@ async function main(): Promise<void> {
'Client',
subCommands([
cloneCommand(argv => {
const { folder, branch, override } = argv;
const { folder, branch, override, protocol } = argv;
clone(clientRepository, {
folder,
branch,
override
override,
protocol
});
}),
buildCommand(argv => {
Expand All @@ -187,11 +201,12 @@ async function main(): Promise<void> {
'Theia integration',
subCommands([
cloneCommand(argv => {
const { folder, branch, override } = argv;
const { folder, branch, override, protocol } = argv;
clone(theiaRepository, {
folder,
branch,
override
override,
protocol
});
}),
buildCommand(argv => {
Expand All @@ -215,11 +230,12 @@ async function main(): Promise<void> {
'VSCode integration',
subCommands([
cloneCommand(argv => {
const { folder, branch, override } = argv;
const { folder, branch, override, protocol } = argv;
clone(vsCodeRepository, {
folder,
branch,
override
override,
protocol
});
}),
buildCommand(argv => {
Expand Down Expand Up @@ -255,6 +271,12 @@ function cloneCommand(handler: (argv: CloneCommandArgv) => void) {
description: 'Rename or remove if the folder already exists',
type: 'string'
} as const)
.options('protocol', {
choices: ['ssh', 'https'],
description: 'Protocol to use for cloning',
type: 'string',
default: 'ssh'
} as const)
.positional('branch', { describe: 'Branch or tag', type: 'string' }),
argv => {
handler(argv);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"devDependencies": {
"@eclipse-glsp/dev": "next",
"@estruyf/github-actions-reporter": "^1.7.0",
"@types/node": "16.x",
"concurrently": "^8.2.2",
"eslint-import-resolver-typescript": "^3.5.3",
Expand Down
59 changes: 59 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
# yarn lockfile v1


"@actions/core@^1.10.0":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a"
integrity sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==
dependencies:
"@actions/http-client" "^2.0.1"
uuid "^8.3.2"

"@actions/http-client@^2.0.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.1.tgz#ed3fe7a5a6d317ac1d39886b0bb999ded229bb38"
integrity sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==
dependencies:
tunnel "^0.0.6"
undici "^5.25.4"

"@ampproject/remapping@^2.2.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4"
Expand Down Expand Up @@ -335,6 +351,20 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f"
integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==

"@estruyf/github-actions-reporter@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@estruyf/github-actions-reporter/-/github-actions-reporter-1.7.0.tgz#704cc9422fb690c59c6536ef0182237248f5dbd9"
integrity sha512-Kucb/LNB9HnU4w1wIxiVyhcLajlT1p/Gs3yyNb4D/skz371Jy67dmq8pb3pL9SEGFXMxQVkHlQL5TegPux/9ag==
dependencies:
"@actions/core" "^1.10.0"
ansi-to-html "^0.7.2"
marked "^12.0.1"

"@fastify/busboy@^2.0.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d"
integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==

"@gar/promisify@^1.1.3":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
Expand Down Expand Up @@ -1301,6 +1331,13 @@ ansi-styles@^6.1.0:
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==

ansi-to-html@^0.7.2:
version "0.7.2"
resolved "https://registry.yarnpkg.com/ansi-to-html/-/ansi-to-html-0.7.2.tgz#a92c149e4184b571eb29a0135ca001a8e2d710cb"
integrity sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==
dependencies:
entities "^2.2.0"

anymatch@~3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
Expand Down Expand Up @@ -2509,6 +2546,11 @@ enquirer@~2.3.6:
dependencies:
ansi-colors "^4.1.1"

entities@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==

env-paths@^2.2.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2"
Expand Down Expand Up @@ -4701,6 +4743,11 @@ map-obj@^4.0.0:
resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a"
integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==

marked@^12.0.1:
version "12.0.2"
resolved "https://registry.yarnpkg.com/marked/-/marked-12.0.2.tgz#b31578fe608b599944c69807b00f18edab84647e"
integrity sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==

meow@^8.1.2:
version "8.1.2"
resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897"
Expand Down Expand Up @@ -7009,6 +7056,11 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"

tunnel@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==

type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
Expand Down Expand Up @@ -7135,6 +7187,13 @@ unbzip2-stream@^1.0.9:
buffer "^5.2.1"
through "^2.3.8"

undici@^5.25.4:
version "5.28.4"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068"
integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==
dependencies:
"@fastify/busboy" "^2.0.0"

unique-filename@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.1.tgz#e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2"
Expand Down

0 comments on commit 0616dc2

Please sign in to comment.