Skip to content

Commit

Permalink
Update test workflow (vscode-icons#3332)
Browse files Browse the repository at this point in the history
* Update test workflow

- Upgrading node version
- Allow fail on non-essential node versions
- Cancel workflow when another commit is made on the same branch
- Run jobs on batch of 3
- Improve code coverage workflow

* updated min node version used

---------

Co-authored-by: Roberto Huertas <[email protected]>
  • Loading branch information
JimiC and robertohuertasm authored Jan 14, 2024
1 parent 2d80a92 commit 282c14d
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 121 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/coverage.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Code Coverage

on:
workflow_run:
workflows:
- Tests
types:
- completed

jobs:
code-climate:
name: Send code coverage report to Code Climate
runs-on: ubuntu-latest
if: >
(
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request' &&
github.repository_owner == 'vscode-icons' &&
github.actor != 'dependabot[bot]'
)
steps:
- name: Cloning repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha }}

- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ github.event.workflow_run.id }}
name: code-coverage-report

- name: Uploading code coverage report
uses: paambaati/codeclimate-action@v5
with:
coverageLocations: lcov.info:lcov
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
59 changes: 0 additions & 59 deletions .github/workflows/test.yaml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Tests

on:
push:
tags-ignore:
- '*'
branches:
- 'master'
- 'main'
pull_request:
branches:
- 'master'
- 'main'
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Node.js ${{ matrix.node }} | ${{ matrix.os }} | ${{ matrix.arch }}
strategy:
max-parallel: 3
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
# https://code.visualstudio.com/updates
# https://www.electronjs.org/releases/stable
# https://github.com/microsoft/vscode/blob/main/package.json#L138
node:
- 16.17.1 # vscode >= 1.78.0
- 16.14.2 # vscode >= 1.71.0 < 1.78.0
arch:
- x64
experimental:
- false
include:
- os: ubuntu-latest
node: node # latest node
arch: x64
experimental: true
- os: macos-latest
node: node # latest node
arch: x64
experimental: true
- os: windows-latest
node: node # latest node
arch: x64
experimental: true
- os: ubuntu-latest
node: lts/* # latest lts node
arch: x64
experimental: true
- os: macos-latest
node: lts/* # latest lts node
arch: x64
experimental: true
- os: windows-latest
node: lts/* # latest lts node
arch: x64
experimental: true
runs-on: ${{ matrix.os }}
steps:
- name: Setting up Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cloning repository
uses: actions/checkout@v3
with:
fetch-depth: 5

- name: Installing Dependencies
run: npm ci

- name: Test
continue-on-error: ${{ matrix.experimental }}
run: npm test

- name: Uploading code coverage report
if: >
(
success() &&
matrix.os == 'ubuntu-latest' &&
matrix.node == '16.14.2' &&
github.event_name == 'push' &&
github.repository_owner == 'vscode-icons' &&
github.actor != 'dependabot[bot]'
)
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

- name: Uploading code coverage artifact
if: >
(
success() &&
matrix.os == 'ubuntu-latest' &&
matrix.node == '16.14.2' &&
github.event_name == 'pull_request' &&
github.repository_owner == 'vscode-icons' &&
github.actor != 'dependabot[bot]'
)
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: coverage/lcov.info
retention-days: 1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.0
16.14.2
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"email": "[email protected]"
},
"engines": {
"vscode": "^1.40.2",
"node": ">=12.4.0"
"vscode": "^1.71.0",
"node": ">=16.14.2"
},
"keywords": [
"icons",
Expand Down

0 comments on commit 282c14d

Please sign in to comment.