Skip to content

Commit

Permalink
Add check-version-bump workflow and junit.xml report to codecov
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Sep 30, 2024
1 parent bab72ee commit 58dbf77
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 3 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 }}
21 changes: 21 additions & 0 deletions .github/workflows/check-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Check Version Bump

on:
pull_request:

jobs:
check-version-bump:
runs-on: ubuntu-latest
steps:
- 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.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 58dbf77

Please sign in to comment.