[CI] enable runtime checks, test with Valgrind #291
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This action generates the documentation and then deploys it to the `gh-pages` branch. | |
name: Documentation & Coverage | |
on: | |
push: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/tttapa/alpaqa-docs:py3.10 | |
options: --user root | |
env: | |
CMAKE_C_COMPILER_LAUNCHER: ccache | |
CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
CCACHE_DIR: /root/.ccache | |
steps: | |
# Checks-out the repository under $GITHUB_WORKSPACE | |
- uses: actions/checkout@v3 | |
- run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
# Create a copy of the repo in /tmp/staging. | |
# Create the `gh-pages` branch if it doesn't exist already, check it out. | |
- name: Create staging area | |
run: | | |
rm -rf /tmp/staging | |
cp -ar $GITHUB_WORKSPACE/ /tmp/staging | |
git config --global --add safe.directory /tmp/staging | |
cd /tmp/staging | |
git fetch origin gh-pages:gh-pages ||: | |
git checkout gh-pages || \ | |
{ git checkout --orphan gh-pages && git rm -rf . && git clean -fxd ; } | |
# Use ccache to cache compilation | |
- name: Prepare ccache directory | |
run: mkdir -p "${{ env.CCACHE_DIR }}" | |
- name: Cache ccache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ${{ runner.os }}-ccache-${{ github.run_id }} | |
restore-keys: ${{ runner.os }}-ccache | |
# Install Python dependencies for generating docs and tests | |
- name: Install Python package and dependencies | |
run: | | |
python3 -m pip install -r doxygen/requirements.txt | |
python3 -m pip install --verbose '.[docs]' | |
python3 -m pip install cmake | |
shell: bash | |
# Generate the documentation and save it in /tmp/staging | |
- name: Generate documentation | |
run: | | |
./doxygen/scripts/gen-docs.sh /tmp/staging | |
./doxygen/scripts/gen-docs-index.sh /tmp/staging md | |
# Commit the new documentation, squash the commits, and push it to GitHub | |
- name: Commit and push documention | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "actions@github.com" | |
commithash=$(git rev-parse HEAD) | |
cd /tmp/staging | |
git add . | |
git commit -m "Documentation for ${commithash}" && \ | |
git reset $(git commit-tree HEAD^{tree} -m "Documentation for ${commithash}") && \ | |
git push -f origin gh-pages ||: |