improved workflows #135
This file contains hidden or 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
| 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 | ||
| 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"]' | ||
| 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-matrix: | ||
| 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 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: ${{ fromJson(env.os) }} | ||
|
Check failure on line 61 in .github/workflows/run-tests.yml
|
||
| julia-version: ${{ fromJson(env.julia-version) }} | ||
| matlab-version: ${{ fromJson(env.matlab-version) }} | ||
| 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 | ||
| steps: | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| - name: Generate outcome tables | ||
| shell: bash | ||
| run: | | ||
| set -e | ||
| os_list=($(echo "$os" | jq -r '.[]')) | ||
| julia_versions=($(echo "$julia_version" | jq -r '.[]')) | ||
| matlab_versions=($(echo "$matlab_version" | jq -r '.[]')) | ||
| for os_name in "${os_list[@]}"; do | ||
| table="| MATLAB / Julia |" | ||
| for julia in "${julia_versions[@]}"; do | ||
| table+=" $julia |" | ||
| done | ||
| table+="\n|---|"$(printf '---|' $(seq 1 ${#julia_versions[@]}))"\n" | ||
| for matlab in ${matlab_versions[@]}; do | ||
| row="| $matlab |" | ||
| for julia in "${julia_versions[@]}"; do | ||
| outcome_file="results-${os_name}-${matlab}-${julia}/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$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 | ||