Merge pull request #5 from JuliaEnergy/dependabot/github_actions/code… #78
This file contains 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 | |
on: | |
push: | |
branches: | |
- main | |
tags: ['*'] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
# Skip intermediate builds: always. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
# Cancel intermediate builds: only if it is a pull request build. | |
# cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
cancel-in-progress: true # allways cancle old runs on new push | |
jobs: | |
test: | |
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ 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' | |
- 'pre' | |
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 | |
- name: Test with specific test dep versions | |
shell: julia --project=testenv --color=yes {0} | |
run: | | |
using Pkg | |
pkg"add NetworkDynamics#main" | |
pkg"dev ." | |
pkg"dev ./OpPoDynTesting" | |
Pkg.test("OpPoDyn"; coverage=true) | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v5 | |
with: | |
files: lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created | |
contents: write | |
statuses: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: 'pre' | |
- uses: julia-actions/cache@v2 | |
- name: Configure doc environment | |
shell: julia --project=docs --color=yes {0} | |
run: | | |
using Pkg | |
pkg"add NetworkDynamics#main" | |
# Pkg.develop(PackageSpec(path=pwd())) # not needed with sources | |
Pkg.instantiate() | |
# - uses: julia-actions/julia-buildpkg@v1 # not necessary and complicated with ND#main | |
- uses: julia-actions/julia-docdeploy@v1 | |
# continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} | |
- name: Run doctests | |
# continue-on-error: true | |
shell: julia --project=docs --color=yes {0} | |
run: | | |
using Documenter: DocMeta, doctest | |
using OpPoDyn | |
DocMeta.setdocmeta!(OpPoDyn, :DocTestSetup, :(using OpPoDyn); recursive=true) | |
doctest(OpPoDyn) |