CI.yml
 1  name: CI
 2  on:
 3    push:
 4      branches:
 5        - main
 6      tags: ['*']
 7    pull_request:
 8    workflow_dispatch:
 9  concurrency:
10    # Skip intermediate builds: always.
11    # Cancel intermediate builds: only if it is a pull request build.
12    group: ${{ github.workflow }}-${{ github.ref }}
13    cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14  jobs:
15    test:
16      name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
17      runs-on: ${{ matrix.os }}
18      timeout-minutes: 60
19      permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
20        actions: write
21        contents: read
22      strategy:
23        fail-fast: false
24        matrix:
25          version:
26            - '1.11'
27            - 'nightly'
28          os:
29            - ubuntu-latest
30          arch:
31            - x64
32      steps:
33        - uses: actions/checkout@v4
34        - uses: julia-actions/setup-julia@v2
35          with:
36            version: ${{ matrix.version }}
37            arch: ${{ matrix.arch }}
38        - uses: julia-actions/cache@v2
39        - uses: julia-actions/julia-buildpkg@v1
40        - uses: julia-actions/julia-runtest@v1
41    docs:
42      name: Documentation
43      runs-on: ubuntu-latest
44      permissions:
45        actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
46        contents: write
47        statuses: write
48      steps:
49        - uses: actions/checkout@v4
50        - uses: julia-actions/setup-julia@v2
51          with:
52            version: '1'
53        - uses: julia-actions/cache@v2
54        - name: Configure doc environment
55          shell: julia --project=docs --color=yes {0}
56          run: |
57            using Pkg
58            Pkg.develop(PackageSpec(path=pwd()))
59            Pkg.instantiate()
60        - uses: julia-actions/julia-buildpkg@v1
61        - uses: julia-actions/julia-docdeploy@v1
62          env:
63            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64            DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
65        - name: Run doctests
66          shell: julia --project=docs --color=yes {0}
67          run: |
68            using Documenter: DocMeta, doctest
69            using GrothAlgebra
70            DocMeta.setdocmeta!(GrothAlgebra, :DocTestSetup, :(using GrothAlgebra); recursive=true)
71            doctest(GrothAlgebra)