From c4d479c32d26e34c6653b0b51629a23291695fa9 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 25 Nov 2026 17:17:59 -0500 Subject: [PATCH 1/6] revert: old `CI.yml` and `Documentation.yml` --- .github/workflows/CI.yml | 69 +++++++++++++++++++++++++++++ .github/workflows/Documentation.yml | 26 +++++++++++ 2 files changed, 95 insertions(+) create mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/Documentation.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000..aad3a97ae --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,69 @@ +name: CI +on: + push: + branches: + - main + tags: ['*'] + pull_request: +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + permissions: # needed for julia-actions/cache delete old caches that it has created + actions: write + contents: read + continue-on-error: ${{ matrix.version == 'pre' }} + strategy: + fail-fast: false + matrix: + version: + - 'lts' # long-term support release + - '1' # latest stable 1.x release + - 'pre' # latest stable prerelease + # - 'nightly' # commented since noisy + 'pre' allows testing upcoming versions + os: + - ubuntu-latest + - macos-latest + - windows-latest + arch: + - x64 + - aarch64 + exclude: + - os: ubuntu-latest + arch: aarch64 + - os: macos-latest + arch: x64 + - os: windows-latest + arch: aarch64 + steps: + - name: Set JULIA_DEBUG environment variable if applicable + if: ${{ runner.debug == '1' }} + run: echo "JULIA_DEBUG=ModelPredictiveControl" >> $GITHUB_ENV + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v6 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}- + ${{ runner.os }}-${{ matrix.arch }}-test- + ${{ runner.os }}-${{ matrix.arch }}- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v7 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false \ No newline at end of file diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 000000000..70a059074 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,26 @@ +name: Documentation + +on: + push: + branches: + - main # update to match your development branch (master, main, dev, trunk, ...) + tags: '*' + pull_request: + +jobs: + build: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 + with: + version: '1' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key + run: julia --project=docs/ docs/make.jl \ No newline at end of file From f087a6dae8e8e9b579f29a10c805334e526bbb96 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 25 Nov 2026 17:18:37 -0500 Subject: [PATCH 2/6] doc: new link for CI badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 706043774..0b5d8ffa0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # ModelPredictiveControl.jl -[![Build Status](https://github.com/JuliaControl/ModelPredictiveControl.jl/actions/workflows/juliaci.yml/badge.svg?branch=main)](https://github.com/JuliaControl/ModelPredictiveControl.jl/actions/workflows/juliaci.yml?query=branch%3Amain) +[![Build Status](https://github.com/JuliaControl/ModelPredictiveControl.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaControl/ModelPredictiveControl.jl/actions/workflows/juliaci.yml?query=branch%3Amain) [![codecov](https://codecov.io/gh/JuliaControl/ModelPredictiveControl.jl/branch/main/graph/badge.svg?token=K4V0L113M4)](https://codecov.io/gh/JuliaControl/ModelPredictiveControl.jl) [![Aqua QA](https://juliatesting.github.io/Aqua.jl/dev/assets/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) [![doc-stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaControl.github.io/ModelPredictiveControl.jl/stable) From acf885837f7a1d7dbf7447fcf698a6b931518e90 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 25 Nov 2026 17:21:54 -0500 Subject: [PATCH 3/6] removed: `juliaci.yml` workflow file --- .github/workflows/juliaci.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/juliaci.yml diff --git a/.github/workflows/juliaci.yml b/.github/workflows/juliaci.yml deleted file mode 100644 index c912170c8..000000000 --- a/.github/workflows/juliaci.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Julia CI - -on: - push: {branches: [main,master], tags: ['**']} - pull_request: {types: [opened,synchronize,reopened,ready_for_review,converted_to_draft]} - issue_comment: {types: [created]} - workflow_dispatch: - inputs: - feature: - type: choice - description: What to run - options: [DocDeploy, LintAndTest, TagBot] - -jobs: - julia-ci: - uses: franckgaga/testitem-workflow/.github/workflows/juliaci.yml@patch-1 - with: - include-windows-x86: false # not worth it, windows 32bit is too uncommon - include-macos-x64: false # most mac are aarch64 nowadays - include-linux-x86: false # would like to include it, but too unreliable for now - permissions: write-all - secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 7f493591c8885f95d227396dbb9295d33c18ca89 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 25 Nov 2026 17:28:15 -0500 Subject: [PATCH 4/6] test: run `pre` only on `ubuntu-latest` --- .github/workflows/CI.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index aad3a97ae..b3170539a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -38,8 +38,12 @@ jobs: arch: aarch64 - os: macos-latest arch: x64 + - os: macos-latest + version: pre - os: windows-latest arch: aarch64 + - os: windows-latest + version: pre steps: - name: Set JULIA_DEBUG environment variable if applicable if: ${{ runner.debug == '1' }} From 67604d9c4b449cde4b210da664a4780f3c4e4f88 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 25 Nov 2026 19:51:23 -0500 Subject: [PATCH 5/6] test: suppress `@warn` in `ExplicitMPC` AD --- test/3_test_predictive_control.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/3_test_predictive_control.jl b/test/3_test_predictive_control.jl index 4475b4404..711b2b878 100644 --- a/test/3_test_predictive_control.jl +++ b/test/3_test_predictive_control.jl @@ -729,7 +729,7 @@ end @testitem "ExplicitMPC autodiff" setup=[SetupMPCtests] begin using .SetupMPCtests, ControlSystemsBase, LinearAlgebra - using ForwardDiff + using Logging, ForwardDiff A = [0.9 0.08; -0.15 0.75] Bu = [0.005, 0.09] @@ -743,7 +743,10 @@ end return moveinput!(mpc, [1.0])[1] end @test_nowarn first_move(0.5) - @test_nowarn ForwardDiff.derivative(first_move, 0.5) + errorlogger = ConsoleLogger(stderr, Logging.Error) + @test_nowarn with_logger(errorlogger) do + ForwardDiff.derivative(first_move, 0.5) + end end From a78daa3f55aa3a716187b009b51ae8babaead275 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Thu, 26 Nov 2026 08:51:23 -0500 Subject: [PATCH 6/6] CI: making "Documentation" clickable for doc preview --- .github/workflows/Documentation.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 70a059074..752a16dde 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -9,18 +9,17 @@ on: jobs: build: + name: Documentation permissions: contents: write + statuses: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: julia-actions/setup-julia@v3 with: version: '1' - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy + - uses: julia-actions/cache@v3 + - uses: julia-actions/julia-docdeploy@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key - run: julia --project=docs/ docs/make.jl \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file