Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelGirodon committed Mar 23, 2024
1 parent 1b41107 commit e82a4ce
Show file tree
Hide file tree
Showing 12 changed files with 26,825 additions and 5,712 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gaelgirodon/ci-badges-action@v1
with:
gist-id: ${{ env.GIST_ID }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm run lint
- run: npm run build
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## 1.2.0 - 2024-03-24

- Upgrade runtime to node20
- Update dependencies

## 1.1.0 - 2023-07-20

- Improve documentation
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ inputs:
description: Include the short ref name (branch or tag) in filenames.
default: 'false'
runs:
using: node16
using: node20
main: dist/index.js
31,780 changes: 26,382 additions & 5,398 deletions dist/index.js

Large diffs are not rendered by default.

716 changes: 420 additions & 296 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ci-badges-action",
"version": "1.1.0",
"version": "1.2.0",
"description": "Badges for test results and code coverage",
"private": true,
"main": "dist/index.js",
Expand Down Expand Up @@ -31,15 +31,15 @@
},
"homepage": "https://github.com/GaelGirodon/ci-badges-action#readme",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@actions/glob": "^0.4.0"
},
"devDependencies": {
"@vercel/ncc": "^0.36.1",
"c8": "^8.0.0",
"eslint": "^8.45.0",
"mocha": "^10.2.0",
"@vercel/ncc": "^0.38.1",
"c8": "^9.1.0",
"eslint": "^8.57.0",
"mocha": "^10.3.0",
"mocha-junit-reporter": "^2.2.1"
}
}
2 changes: 1 addition & 1 deletion src/badges/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export function buildBadge(data) {
if (data.failed > 0) {
content.message += `, ${data.failed} failed`;
}
content.color = data.failed == 0 ? 'brightgreen' : 'red';
content.color = data.failed === 0 ? 'brightgreen' : 'red';
return content;
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function main() {
try {
const badges = (await getReports())
.map(b => buildBadge(b));
gist.update(badges);
await gist.update(badges);
} catch (error) {
core.warning(`An error occurred: ${error.message}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/reports/cobertura.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function getReports(root) {
const report = await fs.readFile(r, { encoding: 'utf8' });
const coverageMatches = report
.match(/(?<=<coverage[^>]+line-rate=")[0-9.]+(?=")/);
if (coverageMatches?.length != 1) {
if (coverageMatches?.length !== 1) {
core.info('Report is not a valid Cobertura report');
continue; // Invalid report file, trying the next one
}
Expand Down
4 changes: 2 additions & 2 deletions src/reports/go.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { globNearest } from '../util/index.js';
export async function getReports(root) {
core.info('Load Go tests and coverage report');
const goMods = await globNearest([join(root, '**/go.mod')]);
if (goMods.length == 0) {
if (goMods.length === 0) {
core.info('go.mod file not found, skipping');
return [];
}
Expand All @@ -24,7 +24,7 @@ export async function getReports(root) {
core.info(`Load Go report '${r}'`);
const report = await fs.readFile(r, { encoding: 'utf8' });
const tests = (report.match(/=== RUN/g) || []).length;
if (tests == 0) {
if (tests === 0) {
continue; // Invalid report file, trying the next one
}
const passed = (report.match(/--- PASS/g) || []).length;
Expand Down
2 changes: 1 addition & 1 deletion src/reports/junit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function getReports(root) {
.match(/(?<=<testsuites[^>]+tests=")[0-9]+(?=")/);
const failedMatches = report
.match(/(?<=<testsuites[^>]+failures=")[0-9]+(?=")/);
if (testsMatches?.length != 1 || failedMatches?.length != 1) {
if (testsMatches?.length !== 1 || failedMatches?.length !== 1) {
core.info('Report is not a valid JUnit report');
continue; // Invalid report file, trying the next one
}
Expand Down

0 comments on commit e82a4ce

Please sign in to comment.