Merge pull request #269 from MagneticResonanceImaging/nh/ohMyThreads #30
Workflow file for this run
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: MRIOperators | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - 'MRIOperators/**' | |
| push: | |
| branches: | |
| - master | |
| - '*' | |
| tags: '*' | |
| paths: | |
| - 'MRIOperators/**' | |
| jobs: | |
| test: | |
| name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| - '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. | |
| - '1.10' #LTS | |
| #- 'nightly' | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| arch: | |
| - x64 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: julia-actions/setup-julia@v1 | |
| with: | |
| version: ${{ matrix.version }} | |
| arch: ${{ matrix.arch }} | |
| - uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-artifacts | |
| with: | |
| path: ~/.julia/artifacts | |
| key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-test-${{ env.cache-name }}- | |
| ${{ runner.os }}-test- | |
| ${{ runner.os }}- | |
| - name: Install MRIOperators | |
| shell: julia --color=yes --project=. {0} | |
| run: | | |
| using Pkg | |
| Pkg.develop([PackageSpec(path=pwd(), subdir="MRIOperators")]) | |
| # Hack, MRIOperators tests depend on MRISimulation | |
| # And MRISimulation depends on MRIOperators | |
| # Can't checkout out latest release if compat breaks | |
| Pkg.develop([PackageSpec(path=pwd(), subdir="MRISimulation")]) | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - name: Run MRIOperators tests | |
| shell: julia --color=yes --project=. {0} | |
| run: | | |
| using Pkg | |
| Pkg.test("MRIOperators", coverage = true) | |
| - uses: julia-actions/julia-processcoverage@v1 | |
| with: | |
| directories: MRIOperators/src,MRIOperators/ext | |
| - uses: codecov/codecov-action@v4 | |
| with: | |
| file: lcov.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: MRIOperators | |
| # Based on https://github.com/SciML/OrdinaryDiffEq.jl/blob/master/.github/workflows/Downstream.yml | |
| breakage: | |
| name: Breakage ${{ matrix.package }} (Julia ${{ matrix.julia-version}}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| julia-version: | |
| - '1.10' | |
| os: | |
| - ubuntu-latest | |
| package: | |
| - MRISimulation | |
| - MRIReco | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.julia-version }} | |
| arch: x64 | |
| - name: Test Breakage ${{ matrix.package }} | |
| env: | |
| BREAK_PKG: ${{ matrix.package }} | |
| shell: julia --color=yes {0} | |
| run: | | |
| using Pkg | |
| try | |
| Pkg.add(ENV["BREAK_PKG"]) # Add for release version | |
| Pkg.develop([PackageSpec(path=pwd(), subdir="MRIOperators")]) | |
| Pkg.test(ENV["BREAK_PKG"], coverage=true) # resolver may fail with test time depsAdd commentMore actions | |
| catch err | |
| err isa Pkg.Resolve.ResolverError || rethrow() | |
| @info "Not compatible with this release. No need to check for breakage" exception=err | |
| exit(0) | |
| end |