Skip to content

Commit c921f8f

Browse files
committed
adding caching to speed up
1 parent 93f372f commit c921f8f

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

.github/workflows/docs.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
build:
1616
env:
1717
BUILD_TYPE: 'Debug'
18-
BUILD_MESON_DIR: '/tmp/build'
18+
BUILD_HDOC_DIR: '/tmp/build'
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
2323

2424
- name: Install dependencies, then configure and build project
2525
run: |
@@ -45,16 +45,27 @@ jobs:
4545
# - name: Install clang
4646
# run: sudo apt-get install clang-17 lld-17 libclang-cpp17-dev
4747

48+
- name: Cache HDOC build
49+
id: cache-hdoc
50+
uses: actions/cache@v4
51+
with:
52+
path: ${{ env.BUILD_HDOC_DIR }}
53+
key: ${{ runner.os }}-primes
54+
4855
- name: Build hdoc
56+
if: steps.cache-hdoc.outputs.cache-hit != 'true'
4957
run: |
58+
cd ${{ env.BUILD_HDOC_DIR }}
5059
git clone https://github.com/PeterTh/hdoc.git
5160
cd hdoc
5261
pip3 install meson
5362
CC=clang-17 CXX=clang++-17 CPP=clang-cpp-17 meson build
5463
sudo ninja -C build
55-
mv build/hdoc /hdoc
56-
cd ..
57-
rm -rf hdoc
64+
65+
- name: Copy hdoc binary
66+
run: |
67+
sudo cp ${{ env.BUILD_HDOC_DIR }}/hdoc/build/hdoc /hdoc
68+
sudo chmod +x /hdoc
5869
5970
6071
- name: Configure CMake
@@ -69,8 +80,8 @@ jobs:
6980

7081
- name: Run hdoc to generate documentation
7182
run: |
72-
chmod +x /hdoc
73-
/hdoc --verbose
83+
sudo chmod +x /hdoc
84+
sudo /hdoc --verbose
7485
7586
- name: Upload documentation to custom server
7687
run: |

0 commit comments

Comments
 (0)