Skip to content

Merge pull request #31 from MilesCranmer/codecov #275

Merge pull request #31 from MilesCranmer/codecov

Merge pull request #31 from MilesCranmer/codecov #275

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
workflow_dispatch:
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: jl${{ matrix.version }}-${{ matrix.os }}-${{ matrix.arch }}-dd=${{ matrix.dispatch_doctor }}-${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1.10'
- '1'
os:
- ubuntu-latest
arch:
- x64
dispatch_doctor:
- 'disabled'
include:
- version: '1'
os: ubuntu-latest
arch: x64
dispatch_doctor: 'enabled'
steps:
- uses: actions/checkout@v4
- name: "Disable DispatchDoctor if needed"
if: ${{ matrix.dispatch_doctor == 'disabled' }}
run: sed -i 's/dispatch_doctor_mode = "error"/dispatch_doctor_mode = "disable"/' test/Project.toml
shell: bash
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: "Run tests"
run: |
julia --color=yes -e 'import Pkg; Pkg.add("Coverage")'
julia --color=yes --threads=auto --check-bounds=yes --depwarn=yes --code-coverage=user -e 'import Coverage; import Pkg; Pkg.activate("."); Pkg.test(coverage=true)'
julia --color=yes coverage.jl
shell: bash
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
statuses: write
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- name: Configure doc environment
run: |
julia --project=docs/ -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY_CAM: ${{ secrets.DAMTP_DEPLOY_KEY }}
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using BorrowChecker
DocMeta.setdocmeta!(BorrowChecker, :DocTestSetup, :(using BorrowChecker); recursive=true)
doctest(BorrowChecker)'