Skip to content

Commit 9a0879e

Browse files
authored
GLSP-1578: Switch to github actions (#115)
- Replace Jenkinsfile with corresponding Github actions workflows - Switch to 2.6.0-next (nightly) versions - Introduce prettier and eslint ignore files - Introduce format and format:check scripts
1 parent 704fe1e commit 9a0879e

File tree

19 files changed

+353
-994
lines changed

19 files changed

+353
-994
lines changed

.eslintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Compiled output
2+
**/dist/
3+
**/lib/
4+
**/node_modules/
5+
6+
# Build files
7+
**/.eslintrc.js
8+
**/esbuild.js
9+
10+
# Other generated files
11+
**/*.map

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
module.exports = {
33
root: true,
44
extends: '@eclipse-glsp',
5-
ignorePatterns: ['**/{node_modules,lib}', '**/.eslintrc.js'],
65

76
parserOptions: {
87
tsconfigRootDir: __dirname,

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
concurrency:
4+
group: ci-${{ github.ref }}
5+
cancel-in-progress: true
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
branches: [main]
12+
13+
jobs:
14+
build:
15+
name: Build
16+
timeout-minutes: 60
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
21+
with:
22+
node-version: 20.x
23+
- name: Build
24+
run: yarn install
25+
- name: Bundle browser example
26+
working-directory: examples/workflow-server
27+
run: yarn bundle:browser
28+
- name: Check for uncommitted changes in yarn.lock
29+
run: |
30+
if git diff --name-only | grep -q "^yarn.lock"; then
31+
echo "::error::The yarn.lock file has uncommitted changes!"
32+
exit 1
33+
fi
34+
test:
35+
name: Test
36+
timeout-minutes: 60
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
40+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
41+
with:
42+
node-version: 20.x
43+
- name: Install
44+
run: |
45+
yarn install
46+
- name: Test
47+
run: |
48+
yarn test:ci
49+
- name: Publish Test Report
50+
uses: ctrf-io/github-test-reporter@646f98cfc16c6f7a0e1f6100cabe2deb95dd2eef # v1.0.22
51+
with:
52+
report-path: 'packages/*/ctrf/*.json'
53+
summary-report: true
54+
file-report: true
55+
if: always()
56+
lint:
57+
name: Lint
58+
timeout-minutes: 60
59+
runs-on: ubuntu-22.04
60+
steps:
61+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
62+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
63+
with:
64+
node-version: 20.x
65+
- name: Install
66+
run: |
67+
yarn install
68+
- name: Create eslint json report
69+
run: |
70+
yarn lint:ci
71+
- name: Create summary
72+
if: always()
73+
run: |
74+
npm_config_yes=true npx github:10up/eslint-json-to-md#82ff16b --path ./eslint_report.json --output ./eslint_report.md
75+
cat eslint_report.md >> $GITHUB_STEP_SUMMARY
76+
coverage:
77+
name: Coverage
78+
timeout-minutes: 60
79+
runs-on: ubuntu-22.04
80+
if: github.ref == 'refs/heads/main'
81+
steps:
82+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
83+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
84+
with:
85+
node-version: 20.x
86+
- name: Install
87+
run: |
88+
yarn install
89+
- name: Run Coverage Tests
90+
run: |
91+
yarn test:coverage:ci
92+
- name: Upload Coverage Report
93+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
94+
with:
95+
name: coverage-report
96+
path: coverage/
97+
if: always()

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
name: 'CodeQL'
1313

1414
on:
15-
push:
16-
branches: [main]
17-
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [main]
15+
workflow_dispatch:
2016
schedule:
21-
- cron: '39 12 * * 6'
17+
- cron: '39 12 * * 6' # Every Saturday at 12:39 UTC
2218

2319
jobs:
2420
analyze:
@@ -38,11 +34,11 @@ jobs:
3834

3935
steps:
4036
- name: Checkout repository
41-
uses: actions/checkout@v3
37+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4238

4339
# Initializes the CodeQL tools for scanning.
4440
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
41+
uses: github/codeql-action/init@16df4fbc19aea13d921737861d6c622bf3cefe23 # v2.23.0
4642
with:
4743
languages: ${{ matrix.language }}
4844
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +49,7 @@ jobs:
5349
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5450
# If this step fails, then you should remove it and run the build manually (see below)
5551
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v2
52+
uses: github/codeql-action/autobuild@16df4fbc19aea13d921737861d6c622bf3cefe23 # v2.23.0
5753

5854
# ℹ️ Command-line programs to run using the OS shell.
5955
# 📚 https://git.io/JvXDl
@@ -67,4 +63,4 @@ jobs:
6763
# make release
6864

6965
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
66+
uses: github/codeql-action/analyze@16df4fbc19aea13d921737861d6c622bf3cefe23 # v2.23.0
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Prepare Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_type:
7+
description: 'Release type (major, minor, patch, next, or custom)'
8+
required: true
9+
type: choice
10+
options:
11+
- major
12+
- minor
13+
- patch
14+
- next
15+
- custom
16+
custom_version:
17+
description: 'Custom version (required if release_type is custom)'
18+
required: false
19+
type: string
20+
branch:
21+
description: 'Branch to use for the release repo (default: default branch)'
22+
required: false
23+
type: string
24+
draft:
25+
description: 'Create PR as draft'
26+
required: false
27+
type: boolean
28+
default: false
29+
30+
jobs:
31+
prepare-release:
32+
uses: eclipse-glsp/glsp/.github/workflows/prepare-release.yml@master
33+
with:
34+
release_type: ${{ inputs.release_type }}
35+
custom_version: ${{ inputs.custom_version }}
36+
release_repo: glsp-server-node
37+
branch: ${{ inputs.branch }}
38+
draft: ${{ inputs.draft }}

.github/workflows/publish-next.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: 'Publish next'
2+
on:
3+
workflow_run:
4+
workflows: ['CI']
5+
types:
6+
- completed
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
id-token: write
12+
jobs:
13+
build:
14+
name: Build & Release
15+
runs-on: ubuntu-22.04
16+
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success')
17+
env:
18+
changes: true
19+
steps:
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
with:
22+
# To fetch all history for all branches and tags.
23+
# Required for lerna to determine the version of the next package.
24+
fetch-depth: 0
25+
ref: ${{ github.event.workflow_run.head_commit.id || github.sha }}
26+
- name: Check for changes in "packages" or "examples" directory
27+
id: check_changes
28+
run: |
29+
if git diff --name-only HEAD^ HEAD | grep -qE '^(packages|examples)'; then
30+
echo "changes=true" >> $GITHUB_ENV
31+
else
32+
echo "changes=false" >> $GITHUB_ENV
33+
fi
34+
if: github.event_name == 'workflow_run'
35+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
36+
with:
37+
node-version: 20.x
38+
registry-url: 'https://registry.npmjs.org'
39+
if: env.changes == 'true'
40+
- name: Build
41+
run: yarn
42+
if: env.changes == 'true'
43+
- name: Publish NPM
44+
run: yarn publish:next
45+
env:
46+
NPM_CONFIG_PROVENANCE: 'true'
47+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
48+
if: env.changes == 'true'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ yarn-error.log
1313
tsconfig.tsbuildinfo
1414
eslint.xml
1515
report.xml
16+
**/ctrf
1617

1718
wf-glsp-server-node.js
1819
wf-glsp-server-node.js.map

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
lib/
6+
dist/
7+
8+
# Generated files
9+
*.min.js
10+
*.min.css
11+
12+
# Lock files
13+
package-lock.json
14+
yarn.lock
15+
16+
# Logs
17+
*.log

0 commit comments

Comments
 (0)