Skip to content

Commit c4d6e3f

Browse files
Add check-version-bump workflow and junit.xml report to codecov (#14)
* Add check-version-bump workflow and junit.xml report to codecov Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Tweak the action Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Tweak the action Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Bump version 0.1.1 Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> --------- Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 08a004e commit c4d6e3f

6 files changed

+77
-4
lines changed

.github/workflows/build-test.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ jobs:
2929
run: npm run build
3030
- name: Upload results to Codecov
3131
uses: codecov/codecov-action@v4
32-
env:
33-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
- name: Upload junit test results to Codecov
35+
if: ${{ !cancelled() }}
36+
uses: codecov/test-results-action@v1
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Check Version Bump
3+
4+
on:
5+
pull_request:
6+
7+
jobs:
8+
check-version-bump:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Check if version has been updated
13+
id: check
14+
uses: EndBug/version-check@v2
15+
16+
- name: Log when changed
17+
if: steps.check.outputs.changed == 'true'
18+
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
19+
20+
- name: Log when unchanged
21+
if: steps.check.outputs.changed == 'false'
22+
run: 'echo "No version change! Please bump the version in package.json!" && exit 1'

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ npm-debug.log
55
!mock-cert.pem
66
.env*
77
coverage
8+
junit.xml
89
bin
910
temp/*
1011

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
testEnvironment: 'node',
33
roots: ['<rootDir>/test'],
4+
reporters: ['default', 'jest-junit'],
45
testMatch: ['**/*.test.ts'],
56
transform: {
67
'^.+\\.tsx?$': 'ts-jest',

package-lock.json

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opensearch-automation-app",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "An Automation App that handles all your GitHub Repository Activities",
55
"author": "Peter Zhu",
66
"homepage": "https://github.com/opensearch-project/automation-app",
@@ -22,7 +22,7 @@
2222
"format": "prettier --write src/**/*.ts test/**/*.ts configs/**/*.yml",
2323
"format-dryrun": "prettier --check src/**/*.ts test/**/*.ts configs/**/*.yml",
2424
"lint": "eslint --fix \"src/**/*.ts\" --ignore-pattern \"**/*.d.ts\"",
25-
"test": "jest --coverage"
25+
"test": "jest --coverage --reporters=jest-junit"
2626
},
2727
"dependencies": {
2828
"@aws-sdk/client-opensearch": "^3.658.1",
@@ -54,6 +54,7 @@
5454
"eslint-plugin-import": "^2.30.0",
5555
"globals": "^15.9.0",
5656
"jest": "^29.7.0",
57+
"jest-junit": "^16.0.0",
5758
"nock": "^14.0.0-beta.5",
5859
"prettier": "^3.3.3",
5960
"smee-client": "^2.0.0",

0 commit comments

Comments
 (0)