Skip to content

Commit

Permalink
Add check-version-bump workflow and junit.xml report to codecov (#14)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
peterzhuamazon authored Oct 1, 2024
1 parent 08a004e commit c4d6e3f
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,10 @@ jobs:
run: npm run build
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload junit test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/check-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Check Version Bump

on:
pull_request:

jobs:
check-version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: 'echo "No version change! Please bump the version in package.json!" && exit 1'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ npm-debug.log
!mock-cert.pem
.env*
coverage
junit.xml
bin
temp/*

Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
reporters: ['default', 'jest-junit'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
Expand Down
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch-automation-app",
"version": "0.1.0",
"version": "0.1.1",
"description": "An Automation App that handles all your GitHub Repository Activities",
"author": "Peter Zhu",
"homepage": "https://github.com/opensearch-project/automation-app",
Expand All @@ -22,7 +22,7 @@
"format": "prettier --write src/**/*.ts test/**/*.ts configs/**/*.yml",
"format-dryrun": "prettier --check src/**/*.ts test/**/*.ts configs/**/*.yml",
"lint": "eslint --fix \"src/**/*.ts\" --ignore-pattern \"**/*.d.ts\"",
"test": "jest --coverage"
"test": "jest --coverage --reporters=jest-junit"
},
"dependencies": {
"@aws-sdk/client-opensearch": "^3.658.1",
Expand Down Expand Up @@ -54,6 +54,7 @@
"eslint-plugin-import": "^2.30.0",
"globals": "^15.9.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"nock": "^14.0.0-beta.5",
"prettier": "^3.3.3",
"smee-client": "^2.0.0",
Expand Down

0 comments on commit c4d6e3f

Please sign in to comment.