Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 39 additions & 35 deletions .github/workflows/build-and-review-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ env:
COVERAGE_SUMMARY_INPUT_FILE: './test/input-files/coverage-summary.md'
TRUNCATE_SUMMARY_INPUT_FILE: './test/input-files/truncate.md'

permissions:
contents: write
pull-requests: write

jobs:
build-and-review-pr:
# This reusable workflow will check to see if an action's source code has changed based on
Expand All @@ -39,7 +43,7 @@ jobs:
# This workflow assumes:
# - The main README.md is at the root of the repo
# - The README contains a contribution guidelines and usage examples section
uses: im-open/.github/.github/workflows/reusable-build-and-review-pr.yml@v1
uses: im-open/.github/.github/workflows/reusable-build-and-review-pr.yml@v2
with:
action-name: ${{ github.repository }}
default-branch: main
Expand Down Expand Up @@ -82,7 +86,7 @@ jobs:
run: echo ""

- name: Setup - Checkout the action
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: '-------------------------------------------------------------------------------------------------------------'
run: echo ""
Expand Down Expand Up @@ -493,7 +497,7 @@ jobs:
fi

- name: Setup - Checkout the action
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: '-------------------------------------------------------------------------------------------------------------'
run: echo ""
Expand Down Expand Up @@ -529,12 +533,12 @@ jobs:

- name: 10e - And the status check should match the inputs
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertStatusCheckExists = require('./test/assert-status-check-exists.js');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.js');
const assertStatusCheckExists = require('./test/assert-status-check-exists.cjs');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.cjs');

const checkId = '${{ steps.no-failures.outputs.status-check-id }}';
const actualCheck = await assertStatusCheckExists(github, context, core, checkId);
Expand Down Expand Up @@ -583,12 +587,12 @@ jobs:

- name: 11e - And the status check should match the inputs
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertStatusCheckExists = require('./test/assert-status-check-exists.js');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.js');
const assertStatusCheckExists = require('./test/assert-status-check-exists.cjs');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.cjs');

const checkId = '${{ steps.ignore-failures.outputs.status-check-id }}';
const actualCheck = await assertStatusCheckExists(github, context, core, checkId);
Expand Down Expand Up @@ -637,12 +641,12 @@ jobs:

- name: 12e - And the status check should match the inputs
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertStatusCheckExists = require('./test/assert-status-check-exists.js');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.js');
const assertStatusCheckExists = require('./test/assert-status-check-exists.cjs');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.cjs');

const checkId = '${{ steps.allow-failures.outputs.status-check-id }}';
const actualCheck = await assertStatusCheckExists(github, context, core, checkId);
Expand Down Expand Up @@ -691,12 +695,12 @@ jobs:

- name: 13e - And the status check should match the inputs
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertStatusCheckExists = require('./test/assert-status-check-exists.js');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.js');
const assertStatusCheckExists = require('./test/assert-status-check-exists.cjs');
const assertStatusCheckMatchesExpectations = require('./test/assert-status-check-matches-expectations.cjs');

const checkId = '${{ steps.threshold-0.outputs.status-check-id }}';
const actualCheck = await assertStatusCheckExists(github, context, core, checkId);
Expand All @@ -718,11 +722,11 @@ jobs:

- name: Teardown - Modify failing Status Check conclusion
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const updateFailingStatusCheck = require('./test/update-failing-status-check.js');
const updateFailingStatusCheck = require('./test/update-failing-status-check.cjs');

await updateFailingStatusCheck(github, context, core, '${{ steps.allow-failures.outputs.status-check-id }}');

Expand Down Expand Up @@ -760,19 +764,19 @@ jobs:
fi

- name: Setup - Checkout the action
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup - Delete pre-existing process-code-coverage-summary PR Comments
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const deletePrComments = require('./test/delete-pre-existing-comments.js');
const deletePrComments = require('./test/delete-pre-existing-comments.cjs');
await deletePrComments(github, context, core);

- name: Setup - Create a process-code-coverage-summary comment that can be updated
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
await github.rest.issues.createComment({
Expand Down Expand Up @@ -825,12 +829,12 @@ jobs:

- name: 14e - And the pr-comment should match the match the expected values
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertCommentExists = require('./test/assert-pr-comment-exists.js');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.js');
const assertCommentExists = require('./test/assert-pr-comment-exists.cjs');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.cjs');

const commentId = '${{ steps.update-with-matching-prefix.outputs.pr-comment-id }}';
const actualComment = await assertCommentExists(github, context, core, commentId);
Expand Down Expand Up @@ -881,12 +885,12 @@ jobs:

- name: 15e - And the pr-comment should match the expected values
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertCommentExists = require('./test/assert-pr-comment-exists.js');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.js');
const assertCommentExists = require('./test/assert-pr-comment-exists.cjs');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.cjs');

const commentId = '${{ steps.update-without-matching-prefix.outputs.pr-comment-id }}';
const actualComment = await assertCommentExists(github, context, core, commentId);
Expand Down Expand Up @@ -937,12 +941,12 @@ jobs:

- name: 16e - And the pr-comment should match the expected values
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertCommentExists = require('./test/assert-pr-comment-exists.js');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.js');
const assertCommentExists = require('./test/assert-pr-comment-exists.cjs');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.cjs');

const commentId = '${{ steps.matching-prefix-no-update.outputs.pr-comment-id }}';
const actualComment = await assertCommentExists(github, context, core, commentId);
Expand Down Expand Up @@ -993,12 +997,12 @@ jobs:

- name: 17e - And the pr-comment should match the expected values
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const assertCommentExists = require('./test/assert-pr-comment-exists.js');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.js');
const assertCommentExists = require('./test/assert-pr-comment-exists.cjs');
const assertCommentMatchesExpectations = require('./test/assert-pr-comment-matches-expectations.cjs');

const commentId = '${{ steps.truncate.outputs.pr-comment-id }}';
const actualComment = await assertCommentExists(github, context, core, commentId);
Expand All @@ -1024,11 +1028,11 @@ jobs:

- name: Teardown - Delete PR Comments
if: always()
uses: actions/github-script@v7
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const deletePrComment = require('./test/delete-pr-comment.js');
const deletePrComment = require('./test/delete-pr-comment.cjs');

await deletePrComment(github, context, core, '${{ env.EXISTING_COMMENT_ID }}');
await deletePrComment(github, context, core, '${{ steps.matching-prefix-no-update.outputs.pr-comment-id }}');
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/increment-version-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ on:
# if this action should be incremented and if new tags should be pushed to the repo based
# on the same criteria used in the build-and-review-pr.yml workflow.

permissions:
contents: write

jobs:
increment-version:
uses: im-open/.github/.github/workflows/reusable-increment-version-on-merge.yml@v1
uses: im-open/.github/.github/workflows/reusable-increment-version-on-merge.yml@v2
with:
default-branch: main

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ jobs:
runs-on: [ubuntu-20.04]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

# dotnet tests
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand All @@ -126,7 +126,7 @@ jobs:
run: dotnet test './src/MyProj.sln' --logger trx --configuration Release /property:CollectCoverage=True /property:CoverletOutputFormat=opencover

- name: ReportGenerator
uses: im-open/code-coverage-report-generator@4
uses: im-open/code-coverage-report-generator@5
with:
reports: '*/**/coverage.opencover.xml'
targetdir: './coverage-results'
Expand All @@ -137,7 +137,7 @@ jobs:
- name: Create a status check for the code coverage results
id: dotnet-coverage-check
# You may also reference just the major or major.minor version
uses: im-open/process-code-coverage-summary@v2.3.1
uses: im-open/process-code-coverage-summary@v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-file: './coverage-results/dotnet-summary.md'
Expand All @@ -158,15 +158,15 @@ jobs:
run: npm run test -- --outputFile=jest-results.json

- name: create code coverage report
uses: im-open/code-coverage-report-generator@4
uses: im-open/code-coverage-report-generator@5
with:
reports: '*/**/lcov.info'
targetdir: ./tests
title: jest code coverage

- name: create status check/comment for code coverage results
id: jest_coverage_check
uses: im-open/process-code-coverage-summary@v2.3.1
uses: im-open/process-code-coverage-summary@v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-file: './coverage-results/jest-summary.md'
Expand Down
Loading
Loading