Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage report posted to codecov #156

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 43 additions & 37 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
name: run-tests
run-name: Installs project and runs project tests
on: [ push, pull_request ]
on: [push, pull_request]
jobs:
run-tests-nix:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 20, 22 ]
name: Tests with code coverage on Ubuntu with Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: |
npm install
npm run compile
# runtTests() which downloads/installs/launches VSCode requires a screen.
# Using xvfb-run to attach a virtual screen for CI running on Ubuntu.
xvfb-run --server-num=99 --server-args="-screen 0 1024x768x24" npm run test-coverage
shell: bash
- run: killall Xvfb || true
run-tests-win:
runs-on: windows-latest
strategy:
matrix:
node: [ 20, 22 ]
name: Tests with code coverage on Windows with Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: |
# On Windows there no need for a screen for runTests() to run successfully.
npm install
npm run compile
npm run test-coverage
- run: taskkill /IM Xvfb.exe /F || true
run-tests-nix:
runs-on: ubuntu-latest
strategy:
matrix:
node: [20, 22]
name: Tests with code coverage on Ubuntu with Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: |
npm install
npm run compile
# runtTests() which downloads/installs/launches VSCode requires a screen.
# Using xvfb-run to attach a virtual screen for CI running on Ubuntu.
xvfb-run --server-num=99 --server-args="-screen 0 1024x768x24" npm run test-coverage
shell: bash
- run: killall Xvfb || true
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/*.json
flags: lsp,extension
run-tests-win:
runs-on: windows-latest
strategy:
matrix:
node: [20, 22]
name: Tests with code coverage on Windows with Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: |
# On Windows there no need for a screen for runTests() to run successfully.
npm install
npm run compile
npm run test-coverage
- run: taskkill /IM Xvfb.exe /F || true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![codecov](https://codecov.io/github/salesforce/salesforcedx-vscode-mobile/branch/main/graph/badge.svg?token=PDZHP80RNO)](https://codecov.io/github/salesforce/salesforcedx-vscode-mobile)

# Salesforce Mobile Extensions for Visual Studio Code

This Visual Studio Code extension provides tools to help developers create their Salesforce Mobile experiences in the VSCode development environment.
Expand Down
18 changes: 18 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: MIT
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
comment:
layout: 'header, diff, tree'
behavior: default
require_changes: false # if true: only post the comment if coverage changes
branches: null
flags: null
paths: null
flags:
extension:
paths:
- src/
lsp:
paths:
- lsp/
2 changes: 1 addition & 1 deletion test/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function run(): Promise<void> {
nyc = new NYC({
...baseConfig,
cwd: path.join(__dirname, '..', '..', '..'),
reporter: ['text-summary', 'html', 'text', 'lcov'],
reporter: ['text-summary', 'html', 'text', 'lcov', 'json'],
all: true,
silent: false,
instrument: true,
Expand Down
Loading