Skip to content

Commit

Permalink
Introduce GIthub actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tortmayr committed Jul 16, 2024
1 parent 483a65b commit 5f3092a
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 154 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: 'CI'

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

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
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
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
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
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'
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/[email protected]
- uses: actions/[email protected]
with:
node-version: '18'
- name: Install dependencies
run: yarn install
- name: Prepare repos
run: yarn repo prepare
- name: Run Playwright tests
run: yarn test
- name: Upload Playwright report
uses: actions/[email protected]
with:
name: playwright-report
path: glsp-playwright/examples/workflow-test/playwright-report/
47 changes: 47 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'Publish next'
on:
workflow_run:
workflows: ['CI']
types:
- completed
workflow_dispatch:

permissions:
id-token: write
jobs:
build:
name: Build & Release
runs-on: ubuntu-latest
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/[email protected]
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/[email protected]
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'
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.

1 change: 0 additions & 1 deletion examples/workflow-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"build": "tsc -b",
"clean": "rimraf --glob lib tsconfig.tsbuildinfo server/*.log",
"lint": "eslint --ext .ts,.tsx ./src ./tests",
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
"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",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
"example": "yarn --cwd ./examples/workflow-test",
"generate:index": "lerna run generate:index && yarn lint:fix",
"lint": "eslint --ext .ts,.tsx --ignore-pattern '**/repositories/**' .",
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
"lint:ci": "yarn lint --output-file eslint_report.json --format json",
"lint:fix": " yarn lint --fix",
"prepare": "lerna run prepare && yarn build",
"publish:latest": "lerna publish from-git --no-push",
"publish:next": "lerna publish preminor --exact --canary --preid next --dist-tag next --no-git-tag-version --no-push --ignore-scripts --yes",
"publish:prepare": "lerna version --ignore-scripts --yes --no-push --exact",
"repo": "yarn example repo",
"test": "cd examples/workflow-test && yarn test",
"test:standalone": "yarn example test:standalone",
"test:theia": "yarn example test:theia",
Expand Down
1 change: 0 additions & 1 deletion packages/glsp-playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"generate:index": "glsp generateIndex src -f",
"lint": "eslint --ext .ts,.tsx ./src",
"lint:all": "yarn lint && yarn circular --no-spinner",
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
"watch": "(concurrently \"tsc -w\" \"tsc-alias -w\")",
"watch:alias": "tsc-alias -w"
},
Expand Down

0 comments on commit 5f3092a

Please sign in to comment.