Skip to content

improved workflows #139

improved workflows

improved workflows #139

Workflow file for this run

name: Testing
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}-${{ github.event.pull_request.merged }}"
cancel-in-progress: true
jobs:
changed-files:
name: Check for changed files
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
changed-workflows: ${{ steps.changed-files.outputs.workflows_any_changed }}
changed-src: ${{ steps.changed-files.outputs.src_any_changed }}
changed-test: ${{ steps.changed-files.outputs.test_any_changed }}
changed-examples: ${{ steps.changed-files.outputs.examples_any_changed }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files_yaml: |
workflows:
- .github/workflows/run-tests*.yml
src:
- src/**
- Project.toml
- Artifacts.toml
test:
- test/**
examples:
- examples/**
test-single:
needs: [changed-files]
if: ${{ needs.changed-files.outputs.changed-workflows || needs.changed-files.outputs.changed-src || needs.changed-files.outputs.changed-test || needs.changed-files.outputs.changed-examples }}
permissions:
contents: read
uses: ./.github/workflows/run-tests-reusable.yml
with:
os: windows-latest
julia-version: 1.11
matlab-version: R2025a
test-matrix:
needs: [changed-files, test-single]
if: ${{ needs.changed-files.outputs.changed-workflows || needs.changed-files.outputs.changed-src || needs.changed-files.outputs.changed-test || needs.changed-files.outputs.changed-examples }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [windows-latest]
julia-version: [1.7, 1.8, 1.9, 1.10, 1.11]
matlab-version: [R2021b, R2022a, R2022b, R2023a, R2023b, R2024a, R2024b, R2025a]
exclude:
- os: windows-latest
julia-version: 1.11
matlab-version: 2025a
uses: ./.github/workflows/run-tests-reusable.yml
with:
os: ${{ matrix.os }}
julia-version: ${{ matrix.julia-version }}
matlab-version: ${{ matrix.matlab-version }}
summary:
name: Summary
needs: [changed-files, test-matrix]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
env:
OS: windows-latest
JULIA_VERSION: 1.7 1.8 1.9 1.10 1.11
MATLAB_VERSION: R2021b R2022a R2022b R2023a R2023b R2024a R2024b R2025a
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Generate outcome tables
continue-on-error: true
shell: bash
run: |
set -e
os_list=($OS)
julia_versions=($JULIA_VERSION)
matlab_versions=($MATLAB_VERSION)
for os_name in ${os_list[@]}; do
echo "Generating outcome table for ${os_name}..."
table="| ${os_name} |"
for julia in ${julia_versions[@]}; do
table+=" $julia |"
done
table+="\n|---|"
for ((i=0; i<${#julia_versions[@]}; i++)); do
table+="---|"
done
table+="\n"
for matlab in ${matlab_versions[@]}; do
row="| $matlab |"
for julia in ${julia_versions[@]}; do
outcome_file=outcome.txt
if [[ -f "$outcome_file" ]]; then
outcome=$(cat "$outcome_file")
else
outcome="N/A"
fi
row+=" $outcome |"
done
table+="$row\n"
done
echo -e "\n### Results for \`${os_name}\`\n\n$table" | tee -a outcome_tables.md
done
cat outcome_tables.md
echo "" >> $GITHUB_STEP_SUMMARY
cat outcome_tables.md >> $GITHUB_STEP_SUMMARY
- name: Generate test summary
if: ${{ needs.changed-files.outputs.changed-workflows || needs.changed-files.outputs.changed-src || needs.changed-files.outputs.changed-test || needs.changed-files.outputs.changed-examples }}
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: results-*/results.xml
action_fail: true