|
| 1 | +name: "Test ModelingToolkit" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths-ignore: |
| 8 | + - 'docs/**' |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + paths-ignore: |
| 13 | + - 'docs/**' |
| 14 | + - 'benchmark/**' |
| 15 | + |
| 16 | +concurrency: |
| 17 | + # Skip intermediate builds: always, but for the master branch. |
| 18 | + # Cancel intermediate builds: always, but for the master branch. |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} |
| 21 | + |
| 22 | +jobs: |
| 23 | + tests: |
| 24 | + name: "Tests" |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + version: |
| 29 | + - "1" |
| 30 | + - "lts" |
| 31 | + - "pre" |
| 32 | + group: |
| 33 | + - InterfaceI |
| 34 | + - InterfaceII |
| 35 | + - Initialization |
| 36 | + - SymbolicIndexingInterface |
| 37 | + - Extensions |
| 38 | + - Downstream |
| 39 | + - FMI |
| 40 | + runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }} |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v6 |
| 43 | + - name: "Setup Julia ${{ matrix.version }}" |
| 44 | + uses: julia-actions/setup-julia@v2 |
| 45 | + with: |
| 46 | + version: "${{ matrix.version }}" |
| 47 | + arch: "${{ runner.arch }}" |
| 48 | + - uses: julia-actions/cache@v2 |
| 49 | + if: ${{ vars.USE_SELF_HOSTED != 'true' }} |
| 50 | + with: |
| 51 | + token: "${{ secrets.GITHUB_TOKEN }}" |
| 52 | + - name: "Create test environment" |
| 53 | + run: mkdir TestModelingToolkit |
| 54 | + - name: "Test ModelingToolkit/${{ matrix.group }}" |
| 55 | + env: |
| 56 | + GROUP: ${{ matrix.group }} |
| 57 | + JULIA_PKG_PRECOMPILE_AUTO: 0 |
| 58 | + shell: julia --color=yes --check-bounds=yes --depwarn=yes --project="./TestModelingToolkit" {0} |
| 59 | + run: | |
| 60 | + using Pkg |
| 61 | + Pkg.develop(; path = ".") |
| 62 | + Pkg.develop(; path = "lib/ModelingToolkitTearing") |
| 63 | + Pkg.add("ModelingToolkit") |
| 64 | + Pkg.test("ModelingToolkit") |
| 65 | + - uses: julia-actions/julia-processcoverage@v1 |
| 66 | + with: |
| 67 | + directories: "src,lib/ModelingToolkitTearing/src" |
| 68 | + - name: "Report Coverage with Codecov" |
| 69 | + uses: codecov/codecov-action@v5 |
| 70 | + with: |
| 71 | + files: lcov.info |
| 72 | + token: "${{ secrets.CODECOV_TOKEN }}" |
| 73 | + fail_ci_if_error: true |
0 commit comments