Skip to content

Commit

Permalink
Merge pull request #2 from DFHack/develop
Browse files Browse the repository at this point in the history
Set language of some code blocks to enable syntax highlighting
  • Loading branch information
fengjixuchui authored Oct 9, 2020
2 parents fa1940a + c228035 commit adc5ca4
Show file tree
Hide file tree
Showing 42 changed files with 3,225 additions and 2,165 deletions.
59 changes: 47 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ${{ matrix.os }}
name: build (Linux, GCC ${{ matrix.gcc }})
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
gcc:
- 4.8
- 7
include:
- os: ubuntu-20.04
gcc: 10
steps:
- name: Set up Python 3
uses: actions/setup-python@v2
Expand All @@ -14,6 +26,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install \
libgtk2.0-0 \
libsdl-image1.2-dev \
libsdl-ttf2.0-dev \
libsdl1.2-dev \
Expand All @@ -23,6 +36,10 @@ jobs:
ninja-build \
zlib1g-dev
pip install sphinx
- name: Install GCC
if: ${{ matrix.gcc < 7 || matrix.gcc > 9 }}
run: |
sudo apt-get install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
- name: Clone DFHack
uses: actions/checkout@v1
with:
Expand All @@ -32,9 +49,9 @@ jobs:
id: env_setup
run: |
DF_VERSION="$(sh travis/get-df-version.sh)"
echo "::set-env name=DF_VERSION::${DF_VERSION}"
echo "::set-output name=df_version::${DF_VERSION}"
echo "::set-env name=DF_FOLDER::${HOME}/DF/${DF_VERSION}/df_linux"
echo "DF_VERSION=${DF_VERSION}" >> $GITHUB_ENV
echo "DF_FOLDER=${HOME}/DF/${DF_VERSION}/df_linux" >> $GITHUB_ENV
- name: Fetch DF cache
uses: actions/cache@v2
with:
Expand All @@ -43,15 +60,10 @@ jobs:
- name: Download DF
run: |
sh travis/download-df.sh
- name: Build docs
run: |
sphinx-build -qW -j3 . docs/html
- name: Upload docs
uses: actions/upload-artifact@v1
with:
name: docs
path: docs/html
- name: Build DFHack
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
run: |
cmake \
-S . \
Expand All @@ -77,12 +89,35 @@ jobs:
name: test-artifacts
path: artifacts
- name: Clean up DF folder
# to prevent DFHack-generated files from ending up in the cache
# prevent DFHack-generated files from ending up in the cache
# (download-df.sh also removes them, this is just to save cache space)
if: success() || failure()
run: |
rm -rf "$DF_FOLDER"
docs:
runs-on: ubuntu-18.04
steps:
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: 3
- name: Install dependencies
run: |
pip install sphinx
- name: Clone DFHack
uses: actions/checkout@v1
with:
submodules: true
- name: Build docs
run: |
sphinx-build -W --keep-going -j3 . docs/html
- name: Upload docs
uses: actions/upload-artifact@v1
with:
name: docs
path: docs/html

lint:
runs-on: ubuntu-18.04
steps:
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
url = ../../DFHack/jsoncpp.git
[submodule "depends/xlsxio"]
path = depends/xlsxio
url = ../../brechtsanders/xlsxio.git
url = ../../DFHack/xlsxio.git
shallow = true
[submodule "depends/libzip"]
path = depends/libzip
url = ../../nih-at/libzip.git
url = ../../DFHack/libzip.git
shallow = true
[submodule "depends/libexpat"]
path = depends/libexpat
url = ../../libexpat/libexpat.git
url = ../../DFHack/libexpat.git
shallow = true
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## some generic CMake magic
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
cmake_policy(SET CMP0048 NEW)
project(dfhack)

if("${CMAKE_GENERATOR}" STREQUAL Ninja)
Expand Down Expand Up @@ -406,6 +407,7 @@ endif()
include_directories(depends/tthread)
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(depends/clsocket/src)
include_directories(depends/xlsxio/include)
add_subdirectory(depends)

find_package(Git REQUIRED)
Expand Down Expand Up @@ -440,6 +442,7 @@ if(BUILD_DOCS)

file(GLOB SPHINX_DEPS
"${CMAKE_CURRENT_SOURCE_DIR}/docs/*.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/guides/*.rst"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/changelog.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_changelog.py"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/images/*.png"
Expand Down
6 changes: 6 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def all_keybinds_documented():
extensions = [
'sphinx.ext.extlinks',
'dfhack.changelog',
'dfhack.lexer',
]

# This config value must be a dictionary of external sites, mapping unique
Expand All @@ -207,6 +208,8 @@ def all_keybinds_documented():
'dffd': ('http://dffd.bay12games.com/file.php?id=%s', 'DFFD file '),
'bug': ('http://www.bay12games.com/dwarves/mantisbt/view.php?id=%s',
'Bug '),
'source': ('https://github.com/DFHack/dfhack/tree/develop/%s', ''),
'source:scripts': ('https://github.com/DFHack/scripts/tree/master/%s', ''),
'issue': ('https://github.com/DFHack/dfhack/issues/%s', 'Issue '),
'commit': ('https://github.com/DFHack/dfhack/commit/%s', 'Commit '),
}
Expand Down Expand Up @@ -280,6 +283,9 @@ def get_version():
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# The default language to highlight source code in.
highlight_language = 'dfhack'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

Expand Down
Loading

0 comments on commit adc5ca4

Please sign in to comment.