-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2432 from farid-zare/developPlus
Develop plus
- Loading branch information
Showing
4 changed files
with
177 additions
and
117 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: cobratoolboxCI (merge, test, and upload) | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Check out merged PR code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run MATLAB Tests | ||
run: | | ||
matlab -batch "run('initCobraToolbox.m'); run('test/testAll.m');" | ||
- name: Convert JUnit to CTRF | ||
run: | | ||
npx junit-to-ctrf ./testReport.junit.xml -o ./ctrf/ctrf-report.json | ||
- name: Upload CTRF Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: testReport | ||
path: ./ctrf/ctrf-report.json | ||
|
||
- name: Save PR Number | ||
run: echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
|
||
- name: Upload PR Number as Artifact | ||
run: echo $PR_NUMBER > pr_number.txt | ||
shell: bash | ||
|
||
- name: Upload PR Number Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pr_number | ||
path: pr_number.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: testReport (Comment on PR) | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['cobratoolboxCI (merge, test, and upload)'] | ||
types: [completed] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
publish-report: | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
|
||
- name: Download CTRF Artifact | ||
uses: dawidd6/action-download-artifact@v8 | ||
with: | ||
name: testReport | ||
run_id: ${{ github.event.workflow_run.id }} | ||
path: artifacts | ||
|
||
- name: Download PR Number Artifact | ||
uses: dawidd6/action-download-artifact@v8 | ||
with: | ||
name: pr_number | ||
run_id: ${{ github.event.workflow_run.id }} | ||
path: pr_number | ||
|
||
- name: Read PR Number | ||
id: read_pr_number | ||
run: | | ||
PR_NUMBER=$(cat pr_number/pr_number.txt) | ||
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV | ||
- name: Publish Test Report | ||
uses: ctrf-io/[email protected] | ||
with: | ||
report-path: 'artifacts/ctrf-report.json' | ||
summary-report: true | ||
failed-report: true | ||
issue: ${{ env.PR_NUMBER }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters