Skip to content

Commit

Permalink
Merge pull request #1222 from bluebandit21/addition/CI_generating_doc…
Browse files Browse the repository at this point in the history
…umentation

Add in CI workflow for generating and deploying documentation to github.io site
  • Loading branch information
poco0317 authored Jan 6, 2023
2 parents b39486e + d17c792 commit 1a106a7
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 67 deletions.
13 changes: 13 additions & 0 deletions .ci/generate_doc_configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Install Etterna requirements
sudo apt-get install build-essential libssl-dev libx11-dev libxrandr-dev libcurl4-openssl-dev libglu1-mesa-dev libpulse-dev libogg-dev libasound-dev libjack-dev

#Install doxygen
sudo apt-get install doxygen

eval "$(luarocks path --bin)"

# Generate Etterna CMake
mkdir build && cd build
cmake -G "Unix Makefiles" -DWITH_CRASHPAD=OFF ..
24 changes: 24 additions & 0 deletions .ci/install_ldoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

mkdir lua_tmp && cd lua_tmp

# Install various requirements
sudo apt install build-essential libreadline-dev unzip

# Acquire and install Lua
curl -R -O http://www.lua.org/ftp/lua-5.1.5.tar.gz
tar -zxf lua-5.1.5.tar.gz
cd lua-5.1.5
make linux
sudo make install
cd ..

# Acquire and install LuaRocks
wget https://luarocks.org/releases/luarocks-3.9.1.tar.gz
tar zxpf luarocks-3.9.1.tar.gz
cd luarocks-3.9.1
./configure && make
sudo make install

# Install ldoc
luarocks install --local ldoc
70 changes: 70 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Workflow for building and deploying Etterna documentation
name: Etterna documentation CI

on:
# Runs on pushes to develop
push:
branches: ["develop"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
#Build job
build:
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout
uses: actions/checkout@v3
- name: Update apt
run: "sudo apt-get update"
- name: Install Ldoc
run: "bash ./.ci/install_ldoc.sh"
- name: Generate LDoc/Doxygen configs
run: "bash ./.ci/generate_doc_configs.sh"
#Jekyll build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./Docs/
destination: ./_site
#Ldoc build
- name: Run LDoc
run: |
cd build
make ldoc
sudo mv ldoc_output ../_site/ldoc
#Doxygen build
- name: Run Doxygen
run: |
cd build
make doxygen
sudo mv doxygen ../_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
51 changes: 26 additions & 25 deletions Docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ Interested in contributing to Etterna? This guide is the place to start!

## Table of Contents

- [Getting Started](#Getting-Started)
- [Quick Start](#Quick-Start)
- [Universal Dependencies](#Universal-Dependencies)
- [Linux Dependencies](#Linux-Dependencies)
- [Pop_OS! Notes](#Pop_OS-Notes)
- [Windows Dependencies](#Windows-Dependencies)
- [macOS Dependencies](#macOS-Dependencies)
- [Project Generation](#Project-Generation)
- [CLI Project Generation](#CLI-Project-Generation)
- [GUI Project Generation](#GUI-Project-Generation)
- [Compiling](#Compiling)
- [Ninja](#Ninja)
- [Linux](#Linux)
- [macOS](#macOS)
- [Windows](#Windows)
- [Distribution](#Distribution)
- [Static Analysis](#Static-Analysis)
- [Getting Started](#getting-started)
- [Quick Start](#quick-start)
- [Universal Dependencies](#universal-dependencies)
- [Linux Dependencies](#linux-dependencies)
- [Pop_OS! Notes](#pop_os-notes)
- [Windows Dependencies](#windows-dependencies)
- [macOS Dependencies](#macos-dependencies)
- [Project Generation](#project-generation)
- [CLI Project Generation](#cli-project-generation)
- [GUI Project Generation](#gui-project-generation)
- [Compiling](#compiling)
- [Ninja](#ninja)
- [Linux](#linux)
- [macOS](#macos)
- [Windows](#windows)
- [Distribution](#distribution)
- [Static Analysis](#static-analysis)
- [cppcheck](#cppcheck)
- [Documentation](#Documentation)
- [C++](#C++-Docs)
- [LDoc](#LDoc)
- [Documentation](#documentation)
- [C++](#c-docs)
- [LDoc](#ldoc)

## Getting Started

To begin, take a look at what [dependencies](#Universal-Dependencies)
To begin, take a look at what [dependencies](#universal-dependencies)
you're going to need to start compiling. Etterna is cross-platform on Linux, macOS, and Windows. Typically, we work off of the `develop` branch, therefore all pull requests should be made towards `develop`.

## Quick Start

Here are some commands for current developers and contributors to get started. More are listed at [Sample CMake Commands](#Sample-CMake-Commands).
Here are some commands for current developers and contributors to get started. More are listed at [Sample CMake Commands](#sample-cmake-commands).

```bash
cmake -G "Unix Makefiles" .. # Linux
Expand All @@ -57,7 +57,7 @@ cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" -G "Xcode" .. # macOS

While most dependencies for macOS and Windows are included in the repo, there are some linux libraries which cannot be included in the repo.

For Pop_OS!, install the `Debian` dependencies, then refer to the [Pop_OS! Notes](#Pop_OS-Notes) section below.
For Pop_OS!, install the `Debian` dependencies, then refer to the [Pop_OS! Notes](#pop_os-notes) section below.

- Debian: `apt install build-essential libssl-dev libx11-dev libxrandr-dev libcurl4-openssl-dev libglu1-mesa-dev libpulse-dev libogg-dev libasound-dev libjack-dev`
- Fedora: `dnf install openssl-static libX11-devel libcurl-devel mesa-libGLU-devel libXrandr-devel libogg-devel pulseaudio-libs-devel alsa-lib-devel jack-audio-connection-kit-devel`
Expand All @@ -74,7 +74,7 @@ The build requires Python 2.7 be installed and symlinked as `python`.

Run `python --version`. If it's ok, skip this section. If `python --version` says `command not found`, run the following:

```
```bash
sudo apt install -y python2.7
sudo ln -s /usr/bin/python2.7 /usr/local/bin/python
```
Expand All @@ -83,7 +83,7 @@ sudo ln -s /usr/bin/python2.7 /usr/local/bin/python

`clang` is required for Crashpad. If you don't want to include Crashpad, add `-DWITH_CRASHPAD=OFF` when running `cmake`. Otherwise, install `clang`:

```
```bash
sudo apt install -y clang
```

Expand Down Expand Up @@ -150,6 +150,7 @@ For the `OPENSSL_ROOT_DIR` parameter, set the directory for where ever the opens
Users building without Crashpad may choose to add the `-DWITH_CRASHPAD=OFF` option at the beginning of the command.

Users of Linux be aware that the game builds on the `Debug` target by default. Here are better alternatives:

- `-DCMAKE_BUILD_TYPE=Release` - Builds Release binary with no symbols, normal optimization.
- `-DCMAKE_BUILD_TYPE=RelWithDebInfo` - Builds Release binary with symbols, useful for debugging if any issues arise, almost same as Release otherwise.

Expand Down
16 changes: 8 additions & 8 deletions Docs/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

Anyone is welcome to contribute! These are the areas where help is needed the most.

* [C++](#C++)
* [Lua](#Lua)
* [Documentation](#Documentation)
* [Translating](#Translating)
* [Packaging](#Packaging)
* [Graphic Design](#Graphic-Design)
* [Chart Making](#Chart-Making)
* [C++](#c)
* [Lua](#lua)
* [Documentation](#documentation)
* [Translating](#translating)
* [Packaging](#packaging)
* [Graphic Design](#graphic-design)
* [Chart Making](#chart-making)

## C++

Expand Down Expand Up @@ -48,7 +48,7 @@ A guide on this can be found in [the translations document](Translations.md).

## Packaging

A few people have complained about the lack of packages for Linux in general. If you'd like to, you can try working on a package for your favorite distro.
A few people have complained about the lack of packages for Linux in general. If you'd like to, you can try working on a package for your favorite distro.

## Graphic Design

Expand Down
Loading

0 comments on commit 1a106a7

Please sign in to comment.