-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (54 loc) · 1.7 KB
/
Copy pathtest_docs.yml
File metadata and controls
61 lines (54 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: test-docs
# Workflow used to test publishing on
on:
push:
branches: [main, pytest]
pull_request:
# schedule:
# - cron: "0 12 * * *" # test every 12 hours
env:
CACHE_NUMBER: 2 # increase to reset cache manually
jobs:
build-docs:
name: "Documentation test build"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
python-version: "3.9"
channel-priority: "strict"
env: "doc"
prefix: /usr/share/miniconda3/envs/doc
pip_path: ~/.cache/pip
steps:
- uses: actions/checkout@v2
- name: check packaging file
run: cat ${{ format('packaging/{0}_env.yml', matrix.env) }}
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: doc
use-mamba: true
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v2
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles(format('packaging/{0}_env.yml', matrix.env)) }}-${{ hashFiles(format('packaging/{0}_requirements.txt', matrix.env)) }}-${{ env.CACHE_NUMBER }}-${{ env.DATE }}
id: cache
- name: Update environment
run: mamba env update -n ${{ matrix.env }} -f ${{ format('packaging/{0}_env.yml', matrix.env) }}
if: steps.cache.outputs.cache-hit != 'true'
- name: Conda info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: Build Documentation
shell: bash -l {0}
working-directory: docs
run: make html