Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Oct 30, 2024
1 parent c565ee1 commit ed4a51c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Update openMINDS_MATLAB

on:
# Triggers the workflow on push or pull request events for the "main" branch
# Triggers the workflow on push to any branch other than main or PR to main
# This way tests will run on any push to a feature branch and when feature
# branches are merged to main, but not repeated when PRs are actually merged.
push:
branches-ignore: ["main", "pipeline", "gh-badges"]
paths-ignore:
- '*README.md'
- '*md'
- '.github/workflows/**'
- 'docs/reports/**'
pull_request:
branches: [ "main" ]

Expand All @@ -25,7 +27,7 @@ jobs:
steps:
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
Expand All @@ -44,21 +46,22 @@ jobs:
# Path to SARIF file relative to the root of the repository
sarif_file: docs/reports/code_issues.sarif

# Runs all tests in the project.
# Run all tests in the project.
- name: Run tests
uses: matlab-actions/run-command@v2
if: always()
with:
command: addpath(genpath("tools")), testToolbox()

# Commit the JSON for the badge for the issues and tests
- name: commit code issues badge JSON
# Commit updated SVG badges for the issues and tests (if changed)
- name: Commit svg badges if updated
if: always()
continue-on-error: true
run: |
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
git config user.email "<>"
git fetch
if [[ $(git add .github/badges/* --dry-run | wc -l) -gt 0 ]]; then
git add .github/badges/*
git commit -m "Update code issues and tests badges"
Expand All @@ -75,22 +78,22 @@ jobs:
files: docs/reports/codecoverage.xml

# Publish test results
- name: Publish Test Results
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "docs/reports/test-results.xml"

# Save the contents of the reports directory as an artifact
- name: Save Reports Directory
- name: Save reports directory
uses: actions/upload-artifact@v4
if: always()
with:
name: reports
path: docs/reports

- name: Checkout gh-badges branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-badges
path: gh-badges
Expand Down

0 comments on commit ed4a51c

Please sign in to comment.