Skip to content

Commit 92f467b

Browse files
committed
test: add missing unit tests
add following assets. - CI workflow (only run the unit test) - coverage reporting
1 parent e0ebac1 commit 92f467b

69 files changed

Lines changed: 7672 additions & 1240 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'vscode-webdriverio Archive Download'
2+
description: 'downloads and decompresses an archive from a previous job'
3+
inputs:
4+
path:
5+
description: 'location to decompress the archive to'
6+
filename:
7+
description: 'the name of the decompressed artifact'
8+
name:
9+
description: 'name of the archive to decompress'
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: ⬇️ Download Build Archive
14+
uses: actions/download-artifact@v4
15+
with:
16+
name: ${{ inputs.name }}
17+
path: ${{ inputs.path }}
18+
19+
- name: 📂 Extract Archive
20+
run: unzip -q -o ${{ inputs.path }}/${{ inputs.filename }} -d ${{ inputs.path }}
21+
shell: bash
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'vscode-webdriverio Setup Workspace'
2+
description: 'Sets up Node.js environment with PNPM for CI/CD workflows'
3+
inputs:
4+
node-version:
5+
description: 'Node.js version to use (e.g., "20")'
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: 🧰 Setup PNPM
12+
uses: pnpm/action-setup@v4
13+
with:
14+
run_install: false
15+
16+
- name: 🛠️ Setup Node.js ${{ inputs.node-version }}
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ inputs.node-version }}
20+
cache: 'pnpm'
21+
22+
- name: ⚙️ Install Dependencies
23+
shell: bash
24+
run: pnpm install --frozen-lockfile
25+
26+
- name: 🔧 Configure Git identity
27+
shell: bash
28+
run: |
29+
git config --global user.email "[email protected]"
30+
git config --global user.name "WebdriverIO Release Bot"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'vscode-webdriverio Archive Upload'
2+
description: 'compresses and uploads an archive to be reused across jobs'
3+
inputs:
4+
paths:
5+
description: 'paths to files or directories to archive (recursive)'
6+
output:
7+
description: 'output file name'
8+
name:
9+
description: 'name of the archive to upload'
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: 🤐 Create Archive (Linux or Mac)
14+
run: zip -q -r ${{ inputs.output }} ${{ inputs.paths }}
15+
shell: bash
16+
if: ${{ runner.os != 'Windows' }}
17+
18+
- name: 🤐 Create Archive (Windows)
19+
run: 7z a -tzip -r ${{ inputs.output }} ${{ inputs.paths }}
20+
shell: bash
21+
if: ${{ runner.os == 'Windows' }}
22+
23+
- name: ⬆️ Upload Archive
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: ${{ inputs.name }}
27+
path: ${{ inputs.output }}

.github/workflows/ci-build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
# Make this a reusable workflow, no value needed
6+
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
7+
inputs:
8+
os:
9+
description: 'OS of runner'
10+
default: 'ubuntu-latest'
11+
type: string
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ${{ inputs.os }}
17+
steps:
18+
- name: 👷 Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
ssh-key: ${{ secrets.DEPLOY_KEY }}
22+
23+
- name: 🛠️ Setup workspace
24+
uses: ./.github/workflows/actions/setup-workspace
25+
with:
26+
node-version: '20'
27+
28+
- name: 🏗️ Build Packages
29+
run: pnpm run compile
30+
shell: bash
31+
32+
- name: ⬆️ Upload Build Artifacts
33+
if: ${{ runner.os == 'Linux' }}
34+
uses: ./.github/workflows/actions/upload-archive
35+
with:
36+
name: vscode-webdriverio
37+
output: vscode-webdriverio-build.zip
38+
paths: dist

.github/workflows/ci-lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on:
4+
workflow_call:
5+
# Make this a reusable workflow, no value needed
6+
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
7+
8+
env:
9+
TURBO_TELEMETRY_DISABLED: 1
10+
11+
jobs:
12+
lint:
13+
name: Lint
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
node-version: ['20']
18+
os: ['ubuntu-latest']
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- name: 👷 Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
ssh-key: ${{ secrets.DEPLOY_KEY }}
25+
26+
- name: 🛠️ Setup workspace
27+
uses: ./.github/workflows/actions/setup-workspace
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
31+
- name: ⬇️ Download Build Archive
32+
uses: ./.github/workflows/actions/download-archive
33+
with:
34+
name: vscode-webdriverio
35+
path: .
36+
filename: vscode-webdriverio-build.zip
37+
38+
- name: 📃 Run the lint
39+
run: pnpm run lint
40+
shell: bash

.github/workflows/ci-unit.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Unit tests
2+
3+
on:
4+
workflow_call:
5+
# Make this a reusable workflow, no value needed
6+
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
7+
8+
jobs:
9+
unit:
10+
name: Unit Tests (${{ matrix.os }}.${{ matrix.node-version }})
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
node-version: ['20']
15+
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- name: 👷 Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
ssh-key: ${{ secrets.DEPLOY_KEY }}
22+
23+
- name: 🛠️ Setup workspace
24+
uses: ./.github/workflows/actions/setup-workspace
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: 🧪 Run the unit test
29+
run: pnpm run test:unit
30+
shell: bash
31+
32+
- name: 🐛 Debug Build
33+
uses: stateful/[email protected]
34+
if: failure()
35+
with:
36+
timeout: '180000'

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- v[0-9]+
8+
tags:
9+
- v[0-9]+.[0-9]+.[0-9]+*
10+
pull_request:
11+
12+
jobs:
13+
build:
14+
name: Build
15+
uses: ./.github/workflows/ci-build.yml
16+
with:
17+
os: 'ubuntu-latest'
18+
19+
lint:
20+
name: Lint
21+
needs: [build]
22+
uses: ./.github/workflows/ci-lint.yml
23+
24+
unit:
25+
name: Unit
26+
uses: ./.github/workflows/ci-unit.yml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6+
coverage

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpx lint-staged
1+
pnpx lint-staged --concurrent false

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
dist
22
pnpm-lock.yaml
33
LICENSE.md
4-

0 commit comments

Comments
 (0)