Skip to content

Commit 1902953

Browse files
authored
Update CI workflow for Julia and caching actions
1 parent 56a792d commit 1902953

File tree

1 file changed

+46
-45
lines changed

1 file changed

+46
-45
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,77 @@
11
name: CI
22
on:
3-
- push
4-
- pull_request
5-
env:
6-
JULIA_NUM_THREADS: 2
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/') }}
714
jobs:
815
test:
9-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
1017
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
1122
strategy:
1223
fail-fast: false
1324
matrix:
1425
version:
1526
- '1.10'
16-
# - 'nightly'
27+
- 'pre'
1728
os:
1829
- ubuntu-latest
19-
# - macOS-latest
20-
# - windows-latest
2130
arch:
2231
- x64
23-
# - x86
24-
exclude:
25-
- os: macOS-latest
26-
# arch: x86
2732
steps:
28-
- uses: actions/checkout@v2
29-
- uses: julia-actions/setup-julia@v1
33+
- uses: actions/checkout@v4
34+
- uses: julia-actions/setup-julia@v2
3035
with:
3136
version: ${{ matrix.version }}
3237
arch: ${{ matrix.arch }}
33-
- uses: actions/cache@v1
34-
env:
35-
cache-name: cache-artifacts
36-
with:
37-
path: ~/.julia/artifacts
38-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
39-
restore-keys: |
40-
${{ runner.os }}-test-${{ env.cache-name }}-
41-
${{ runner.os }}-test-
42-
${{ runner.os }}-
38+
- uses: julia-actions/cache@v2
4339
- uses: julia-actions/julia-buildpkg@v1
4440
- uses: julia-actions/julia-runtest@v1
4541
- uses: julia-actions/julia-processcoverage@v1
46-
- uses: codecov/codecov-action@v1
42+
- uses: codecov/codecov-action@v4
4743
with:
48-
file: lcov.info
44+
files: lcov.info
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
fail_ci_if_error: false
4947
docs:
5048
name: Documentation
5149
runs-on: ubuntu-latest
50+
permissions:
51+
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
52+
contents: write
53+
statuses: write
5254
steps:
53-
- uses: actions/checkout@v2
54-
- uses: julia-actions/setup-julia@v1
55+
- uses: actions/checkout@v4
56+
- uses: julia-actions/setup-julia@v2
5557
with:
5658
version: '1'
57-
- run: |
58-
julia --project=docs -e '
59-
using Pkg
60-
Pkg.develop(PackageSpec(path=pwd()))
61-
Pkg.add(PackageSpec(name="Healpix", rev="master"));
62-
Pkg.instantiate()'
63-
- run: |
64-
julia --project=docs -e '
65-
using Pkg
66-
Pkg.develop(PackageSpec(path=pwd()))
67-
Pkg.instantiate()'
68-
- run: |
69-
julia --project=docs -e '
70-
using Documenter: doctest
71-
using XGPaint
72-
doctest(XGPaint)'
73-
- run: julia --project=docs docs/make.jl
59+
- uses: julia-actions/cache@v2
60+
- name: Configure doc environment
61+
shell: julia --project=docs --color=yes {0}
62+
run: |
63+
using Pkg
64+
Pkg.develop(PackageSpec(path=pwd()))
65+
Pkg.instantiate()
66+
- uses: julia-actions/julia-buildpkg@v1
67+
- uses: julia-actions/julia-docdeploy@v1
7468
env:
7569
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7670
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
71+
- name: Run doctests
72+
shell: julia --project=docs --color=yes {0}
73+
run: |
74+
using Documenter: DocMeta, doctest
75+
using XGPaint
76+
DocMeta.setdocmeta!(XGPaint, :DocTestSetup, :(using XGPaint); recursive=true)
77+
doctest(XGPaint)

0 commit comments

Comments
 (0)