-
Notifications
You must be signed in to change notification settings - Fork 299
168 lines (148 loc) · 5.7 KB
/
docs_docker-run.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Documentation builds (HTML)
on:
schedule:
- cron: '0 2 * * *' # daily
- cron: '0 4 * * 1' # weekly
workflow_dispatch:
inputs:
expensive:
description: 'Build expensive docs'
required: false
type: boolean
push:
branches: [ 'master', 'main', 'develop', 'actions_docs' ]
tags: [ 'v*' ]
pull_request:
branches: [ 'master', 'main', 'develop' ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/coolprop/coolprop_docs_02_builder:dev
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
if: ${{ !env.ACT }} # skip during local actions testing
id: cached-props # steps.cached-props.outputs.cache-hit != 'true'
with:
path: |
./Web/fluid_properties/fluids/Consistencyplots
./Web/_static/fluid_properties/Incompressibles_reports
./Web/fluid_properties/Incompressibles_mass-based-fluids
./Web/fluid_properties/Incompressibles_mole-based-fluids
./Web/fluid_properties/Incompressibles_volume-based-fluids
./Web/fluid_properties/Incompressibles_pure-fluids
./Web/scripts/incompressibles_consistency
key: cached-props
#key: cached-props-${{ github.sha }}
#restore-keys: |
# cached-props-
- name: Schedule calculations
id: schedule_calculation
shell: bash
run: |
set -x
echo ${{ github.event.schedule }}
echo "COOLPROP_DAILY=${{ github.event.schedule == '0 2 * * *' }}" >> $GITHUB_ENV
echo "COOLPROP_WEEKLY=${{ github.event.schedule == '0 4 * * 1' }}" >> $GITHUB_ENV
echo ${{ github.ref }}
echo "COOLPROP_TAGGED=${{ contains(github.ref, 'refs/tags') }}" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Variable calculations
id: variable_calculation
shell: bash
run: |
set -x
conda install -y packaging
echo "COOLPROP_VERSION=$(python dev/extract_version.py --cmake-only)" >> $GITHUB_ENV
echo "COOLPROP_EXPENSIVE=${{ (steps.cached-props.outputs.cache-hit != 'true') || inputs.expensive || env.COOLPROP_TAGGED || env.COOLPROP_WEEKLY }}" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Build and install wheel using bdist_wheel
working-directory: ./wrappers/Python/
shell: bash
run: |
source activate docs
python setup.py bdist_wheel --dist-dir dist cmake=default,64
pip install -vvv --force-reinstall --ignore-installed --upgrade --no-index `ls dist/*.whl`
- name: Test the installed CoolProp version
shell: bash
run: |
source activate docs
python -c "import CoolProp; print(CoolProp.__gitrevision__)"
python -c "import CoolProp; print(CoolProp.__file__)"
- name: Build homepage and create graphs
# Use a single argument with "True" or "1" to trigger a full rebuild
working-directory: ./Web/scripts/
shell: bash
run: |
source activate docs
echo "Calling: python -u __init__.py ${{ env.COOLPROP_EXPENSIVE }}"
python -u __init__.py ${{ env.COOLPROP_EXPENSIVE }}
- name: Build documentation with Doxygen
shell: bash
run: |
source activate docs
doxygen --version
doxygen Doxyfile
- name: Build documentation with Sphinx
working-directory: ./Web
shell: bash
run: |
source activate docs
sphinx-apidoc -T -f -e -o apidoc ../wrappers/Python/CoolProp
make html
- name: Upload GitHub Pages artifact
if: ${{ !env.ACT }} # skip during local actions testing
uses: actions/upload-pages-artifact@v1
with:
path: ./Web/_build/html/
- name: Zip the HTML documentation
working-directory: ./Web/_build/
shell: bash
run: |
tar -cvzf CoolProp-${{ env.COOLPROP_VERSION }}-documentation-html.tar.gz html/*
# zip -rq CoolProp-${{ env.COOLPROP_VERSION }}-documentation-html.zip html/*
- name: Archive TGZ or ZIP artifacts
if: ${{ !env.ACT }} # skip during local actions testing
uses: actions/upload-artifact@v3
with:
name: docs
path: |
Web/_build/CoolProp-${{ env.COOLPROP_VERSION }}-documentation-html.tar.gz
# Web/_build/CoolProp-${{ env.COOLPROP_VERSION }}-documentation-html.zip
#- name: Upload TGZ or ZIP to release
# if: contains(github.ref, 'refs/tags')
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: Web/_build/CoolProp-${{ env.COOLPROP_VERSION }}-documentation-html.tar.gz
# tag: ${{ github.ref }}
# overwrite: true
# file_glob: false
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# Do not deploy intermediate builds
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
#if: contains(github.ref, 'refs/tags')
if: ${{ !env.ACT }} # skip during local actions testing
id: deployment
uses: actions/deploy-pages@v1