|
| 1 | +name: "Downstream" |
| 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: ${{ matrix.package.repo }}/${{ matrix.package.group }}/${{ matrix.julia-version }} |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + env: |
| 27 | + GROUP: ${{ matrix.package.group }} |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + julia-version: [1] |
| 32 | + os: [ubuntu-latest] |
| 33 | + package: |
| 34 | + - {user: JuliaComputing, repo: MultibodyComponents.jl, group: All} |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v6 |
| 37 | + - uses: julia-actions/setup-julia@v2 |
| 38 | + with: |
| 39 | + version: ${{ matrix.julia-version }} |
| 40 | + arch: x64 |
| 41 | + - uses: julia-actions/julia-buildpkg@latest |
| 42 | + - name: Clone Downstream |
| 43 | + uses: actions/checkout@v6 |
| 44 | + with: |
| 45 | + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} |
| 46 | + path: downstream |
| 47 | + - name: Load this and run the downstream tests |
| 48 | + shell: julia --color=yes --project=downstream {0} |
| 49 | + run: | |
| 50 | + using Pkg |
| 51 | + try |
| 52 | + # force it to use this PR's version of the package |
| 53 | + Pkg.develop([PackageSpec(path="./lib/ModelingToolkitTearing"), PackageSpec(path=".")]) # resolver may fail with main deps |
| 54 | + Pkg.update() |
| 55 | + Pkg.test(coverage=true) # resolver may fail with test time deps |
| 56 | + catch err |
| 57 | + err isa Pkg.Resolve.ResolverError || rethrow() |
| 58 | + # If we can't resolve that means this is incompatible by SemVer and this is fine |
| 59 | + # It means we marked this as a breaking change, so we don't need to worry about |
| 60 | + # Mistakenly introducing a breaking change, as we have intentionally made one |
| 61 | + @info "Not compatible with this release. No problem." exception=err |
| 62 | + exit(0) # Exit immediately, as a success |
| 63 | + end |
| 64 | + - uses: julia-actions/julia-processcoverage@v1 |
| 65 | + with: |
| 66 | + directories: "src,lib/ModelingToolkitTearing/src" |
| 67 | + - name: "Report Coverage with Codecov" |
| 68 | + uses: codecov/codecov-action@v5 |
| 69 | + with: |
| 70 | + files: lcov.info |
| 71 | + token: "${{ secrets.CODECOV_TOKEN }}" |
| 72 | + fail_ci_if_error: false |
0 commit comments