Test julia-version
action
#1180
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: CI | |
# Run on main, tags, or any pull request | |
on: | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
pull_request: | |
paths: | |
- "src/**/*.jl" | |
- "test/**/*.jl" | |
- "Project.toml" | |
- ".github/workflows/CI.yml" | |
jobs: | |
resolve-version: | |
name: Resolve Julia Version ${{ matrix.version }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- "min" # Oldest supported version | |
- "lts" # LTS | |
- "1" # Latest Release | |
outputs: | |
json: ${{ steps.matrix-output.outputs.json }} | |
steps: | |
- uses: actions/checkout@v4 # Needed for Project.toml | |
- uses: julia-actions/julia-version@cv/implementation | |
with: | |
version: ${{ matrix.version }} | |
- uses: beacon-biosignals/matrix-output@v1 | |
id: matrix-output | |
with: | |
yaml: | | |
version: ${{ steps.julia-version.outputs.version }} | |
test: | |
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} | |
needs: resolve-version | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ${{ fromJSON(needs.resolve-version.outputs.json).version }} | |
os: | |
- ubuntu-latest | |
arch: | |
- x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: ${{ matrix.version }} | |
arch: ${{ matrix.arch }} | |
- uses: julia-actions/cache@v2 | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: julia-actions/julia-runtest@v1 | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v4 | |
with: | |
files: lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
doc-tests: | |
name: Doctests | |
runs-on: ubuntu-latest | |
# These permissions are needed to: | |
# - Checkout the repo | |
# - Delete old caches: https://github.com/julia-actions/cache#usage | |
# - Deploy the docs to the `gh-pages` branch: https://documenter.juliadocs.org/stable/man/hosting/#Permissions | |
permissions: | |
actions: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
- uses: julia-actions/cache@v2 | |
- name: Configure docs environment | |
shell: julia --project=docs --color=yes {0} | |
run: | | |
using Pkg | |
Pkg.develop(PackageSpec(path=pwd())) | |
Pkg.instantiate() | |
- name: Run Doctests | |
shell: julia --project=docs --color=yes {0} | |
run: | | |
using Documenter: DocMeta, doctest | |
using Mocking: Mocking | |
setup = quote | |
using Mocking: @mock, @patch, activate, apply | |
activate() | |
end | |
DocMeta.setdocmeta!(Mocking, :DocTestSetup, setup; recursive=true) | |
doctest(Mocking; manual=false) |