Skip to content

Commit

Permalink
GLSP-1369: Update id locators in tests to align with workflow example (
Browse files Browse the repository at this point in the history
…#12)

- Update id locators in tests
- Switch to composite ts build
- Update to latest dev config
- Introduce `generate:index` helper script
- Regenerate indices
- Set version to 2.2.0 to align with other GLSP components
- Update & cleanup package dependencies
-  Update examples/workflow-test/scripts/repositories.ts
- Introduce GIthub actions workflow
- Remove Jenkinsfile

Co-authored-by: Haydar Metin <hmetin@eclipsesource.com>
  • Loading branch information
tortmayr and haydar-metin authored Jul 17, 2024
1 parent 4e2784a commit 1e2e0bf
Show file tree
Hide file tree
Showing 47 changed files with 3,240 additions and 2,289 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci-cancel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Cancel currently running CI workflows
on:
workflow_run:
workflows: ['CI']
types:
- requested
jobs:
cancel:
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa #v0.12.1
with:
ignore_sha: true
workflow_id: ${{ github.event.workflow.id }}
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: 'CI'

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
- name: Install dependencies
run: yarn install
- name: Check for uncommitted changes in yarn.lock
run: |
if git diff --name-only | grep -q "^yarn.lock"; then
echo "::error::The yarn.lock file has uncommitted changes!"
exit 1
fi
lint:
name: Lint
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
- name: Install
run: |
yarn install --ignore-scripts
yarn compile
- name: Create eslint json report
run: |
yarn lint:ci
continue-on-error: true
- name: Create summary
run: |
npm_config_yes=true npx github:10up/eslint-json-to-md#82ff16b --path ./eslint_report.json --output ./eslint_report.md
cat eslint_report.md >> $GITHUB_STEP_SUMMARY
playwright:
name: Playwright Tests
timeout-minutes: 120
runs-on: ubuntu-latest
env:
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'
VSCODE_VSIX_PATH: '${{ github.workspace }}/examples/workflow-test/repositories/glsp-vscode-integration/example/workflow/extension/workflow-vscode-example-2.2.0-next.vsix'
GLSP_SERVER_DEBUG: 'true'
GLSP_SERVER_PORT: '8081'
GLSP_SERVER_PLAYWRIGHT_MANAGED: 'true'
GLSP_WEBSOCKET_PATH: 'workflow'

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/setup-node@v4.0.2
with:
node-version: '18'
- name: Install dependencies
run: yarn install
- name: Prepare repos
run: yarn repo prepare --protocol https
- name: Start theia
run: yarn repo theia-integration start &
- name: Run Playwright tests
run: xvfb-run -a yarn test
continue-on-error: true
- name: Upload Playwright report
uses: actions/upload-artifact@v4.3.4
with:
name: playwright-report
path: examples/workflow-test/playwright-report/
48 changes: 48 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Publish next'
on:
workflow_run:
workflows: ['CI']
types:
- completed
workflow_dispatch:

permissions:
id-token: write
jobs:
publish:
name: Build & Publish
runs-on: ubuntu-latest
timeout-minutes: 60
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')
env:
changes: true
steps:
- uses: actions/checkout@v4.1.7
with:
# To fetch all history for all branches and tags.
# Required for lerna to determine the version of the next package.
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_commit.id || github.sha }}
- name: Check for changes in "packages" or "examples" directory
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -qE '^(packages|examples)'; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
if: github.event_name == 'workflow_run'
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
if: env.changes == 'true'
- name: Build
run: yarn --skip-integrity-check --network-timeout 100000
if: env.changes == 'true'
- name: Publish NPM
run: yarn publish:next
env:
NPM_CONFIG_PROVENANCE: 'true'
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
if: env.changes == 'true'
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ examples/workflow-test/playwright/.storage/*.json
*.vsix
!*.env.example
*.env


11 changes: 9 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"task.autoDetect": "off",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.autoImportFileExcludePatterns": ["packages/*/src/index.ts"],
"typescript.preferences.autoImportFileExcludePatterns": [
"packages/*/src/index.ts"
],
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand All @@ -40,7 +42,12 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2
},
"[github-actions-workflow]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2
},
"markdownlint.config": {
"MD007": {
Expand Down
149 changes: 0 additions & 149 deletions Jenkinsfile

This file was deleted.

5 changes: 0 additions & 5 deletions examples/workflow-test/.eslintrc.js

This file was deleted.

17 changes: 7 additions & 10 deletions examples/workflow-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-glsp/workflow-test",
"version": "2.0.0",
"version": "2.2.0-next",
"private": true,
"description": "Example project for glsp-playwright",
"homepage": "https://www.eclipse.org/glsp/",
Expand Down Expand Up @@ -31,13 +31,10 @@
],
"scripts": {
"build": "tsc -b",
"check-types": "tsc --noemit",
"clean": "rimraf --glob lib tsconfig.tsbuildinfo server/*.log",
"lint": "eslint --ext .ts,.tsx ./src ./tests",
"lint:all": "yarn check-types && yarn lint",
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
"prepare": "yarn clean && yarn build && yarn lint && playwright install",
"repo": "npx tsx ./scripts/repositories.ts",
"prepare": "playwright install",
"repo": "ts-node ./scripts/repositories.ts",
"start:server": "node node_modules/@eclipse-glsp-examples/workflow-server-bundled/wf-glsp-server-node.js",
"test": "playwright test",
"test:standalone": "yarn test --project=standalone",
Expand All @@ -47,13 +44,13 @@
"watch": "tsc -w"
},
"devDependencies": {
"@eclipse-glsp-examples/workflow-server-bundled": "~2.1.1",
"@eclipse-glsp/glsp-playwright": "~2.0.0",
"@playwright/test": "^1.40.1",
"@eclipse-glsp-examples/workflow-server-bundled": "next",
"@eclipse-glsp/glsp-playwright": "2.2.0-next",
"@playwright/test": "^1.37.1",
"@theia/playwright": "~1.49.1",
"@types/yargs": "^17.0.32",
"dotenv": "^16.0.3",
"ts-dedent": "^2.2.0",
"tsx": "^3.12.4",
"yargs": "^17.7.2"
},
"publishConfig": {
Expand Down
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
Loading

0 comments on commit 1e2e0bf

Please sign in to comment.