Skip to content

Merge pull request #28 from maxortner01/documentation #50

Merge pull request #28 from maxortner01/documentation

Merge pull request #28 from maxortner01/documentation #50

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v1
with:
submodules: true
- name: "Install deps for docs"
run: brew install doxygen zlib bash cmake pkgconfig dwarfutils openssl
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: "Python env"
run: python3 -m venv ${{ steps.strings.outputs.build-output-dir }}/env &&
source ${{ steps.strings.outputs.build-output-dir }}/env/bin/activate &&
python3 -m pip install requests pycairo rsvg
# Runs a single command using the runners shell
- name: Configure docs
run: cmake -B ${{ steps.strings.outputs.build-output-dir }} -DSL_BUILD_LIB=OFF -DSL_BUILD_DOCS=ON -S ${{ github.workspace }}
- name: Build docs
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
- name: Configure coverage
run: cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_BUILD_TYPE=Debug -DSL_BUILD_LIB=ON -DSL_UNIT_TESTS=ON -DSL_CODE_COVERAGE=ON -DSL_BUILD_DOCS=OFF -S ${{ github.workspace }}
- name: Run coverage
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
- name: Run kcov
run: sudo ${{ steps.strings.outputs.build-output-dir }}/kcov-prefix/src/kcov-build/src/kcov --include-path=${{ github.workspace }}/include ${{ steps.strings.outputs.build-output-dir }}/cov_hello_test ${{ steps.strings.outputs.build-output-dir }}/hello_test &&
sudo ${{ steps.strings.outputs.build-output-dir }}/kcov-prefix/src/kcov-build/src/kcov --include-path=${{ github.workspace }}/include ${{ steps.strings.outputs.build-output-dir }}/cov_lua_file ${{ steps.strings.outputs.build-output-dir }}/lua_file &&
sudo ${{ steps.strings.outputs.build-output-dir }}/kcov-prefix/src/kcov-build/src/kcov --merge ${{ steps.strings.outputs.build-output-dir }}/coverage ${{ steps.strings.outputs.build-output-dir }}/cov_* &&
sudo rsync -av ${{ steps.strings.outputs.build-output-dir }}/coverage/. ${{ steps.strings.outputs.build-output-dir }}/docs/html --exclude=index.html &&
sudo cp ${{ steps.strings.outputs.build-output-dir }}/coverage/index.html ${{ steps.strings.outputs.build-output-dir }}/docs/html/coverage.html
- name: Run python script
run: source ${{ steps.strings.outputs.build-output-dir }}/env/bin/activate && sudo python3 ${{ github.workspace }}/docs/get_url.py ${{ steps.strings.outputs.build-output-dir }}/docs/html
- name: Create GitHub Pages artifact
uses: actions/[email protected]
with:
path: ${{ steps.strings.outputs.build-output-dir }}/docs/html
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# 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
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action