Skip to content

Commit

Permalink
fixed merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Duskhorn committed Jul 11, 2024
2 parents 9fd0526 + 8dd9fe1 commit 9d25be5
Show file tree
Hide file tree
Showing 187 changed files with 36,438 additions and 22,098 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
28 changes: 28 additions & 0 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Makefile CI (Clang C++20)

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Update package list
run: sudo apt-get update

- name: Install dependencies
run: sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libglew-dev clang

- name: Build
run: make CXX=clang CPP_20=1 -C src -j4

- name: Upload libprimis.so artifact
uses: actions/upload-artifact@v4
with:
name: libprimis-linux
path: ./src/libprimis.so
91 changes: 76 additions & 15 deletions .github/workflows/doxyfile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Doxyfile CD
name: GH Pages CD

# Controls when the workflow will run.
on:
Expand All @@ -9,6 +9,18 @@ on:
# 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 only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# 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 "run-doxygen"
Expand All @@ -17,20 +29,20 @@ jobs:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# Get the libprimis-header submodules.
submodules: true

# Show the current working directory. Nice for debugging.
- run: pwd

# Show what files are in the repo. Nice for debugging.
- run: ls --recursive

- name: Doxygen Action
# You may pin to the exact commit or the version.
# uses: mattnotmitt/doxygen-action@9039b4cfaf5097b76489c53c0cdc8cba59091b57
Expand All @@ -48,14 +60,63 @@ jobs:
enable-latex: false
# Extra alpine packages for the build environment.
# additional-packages: # optional

# Show what files were created. Nice for debugging.
- run: ls --recursive

- name: Deploy
uses: peaceiris/actions-gh-pages@v3

# Now build the test suite, for gcov files
- name: Update package list
run: sudo apt-get update

- name: Install dependencies
run: sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libglew-dev lcov

- name: Build
run: make CPP_20=1 -Csrc -j4 COVERAGE_BUILD=1

- name: Move library to ld path
run: sudo cp src/libprimis.so /usr/lib/libprimis.so

- name: Build test code
run: cd test && make

- name: Run tests
run: cd test && ./libprimis_testsuite

- name: Build lcov tracefile
run: lcov -c -d . -o output && lcov -r output "/usr*" -o output && lcov -r output "*/test/*" -o output

- name: Build lcov HTML
run: genhtml -o lcov -t "Libprimis Test Coverage" --num-spaces 4 output

- name: Move lcov HTML to docs dir
run: sudo cp -r lcov docs/lcov

#Generates float value from lcov summary for tests, then generates its int representation;
#macro substitutes it into SVG template to generate badge
#We can just host this object along with the website, then reference it to have a dynamic frontpage badge,
#instead of using an external service
- name: Generate coverage badge
run: pct=$(lcov --summary output | grep "lines" | cut -d "%" -f1 | cut -d ":" -f2 | cut -d " " -f2);
ipct=$(echo $pct | cut -d "." -f1);
gcc -xc -E -P test/coverage.svg -DVAL=$pct -DIVAL=$ipct > covout.svg

- name: Move coverage badge to docs
run: sudo cp covout.svg docs/lcov/coverage.svg

- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload _site/ directory
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Upload man pages
uses: actions/upload-artifact@v4
with:
# Provide a GitHub token to authenticate pushing files.
github_token: ${{ secrets.GITHUB_TOKEN }}
# Push documentation files in docs folder to gh-pages repo.
publish_dir: ./docs
name: libprimis-doc
path: ./doc/man/man3/
6 changes: 3 additions & 3 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Makefile CI
name: Makefile CI (GCC C++17)

on: [push]

Expand All @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -22,7 +22,7 @@ jobs:
run: make -C src -j4

- name: Upload libprimis.so artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libprimis-linux
path: ./src/libprimis.so
6 changes: 3 additions & 3 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:

steps:
- name: Clone repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2.0.0

# errors due to this project not using NuGet
# - name: Restore NuGet packages
Expand All @@ -36,7 +36,7 @@ jobs:
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

- name: Upload libprimis.lib artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libprimis-windows
path: ./bin64/libprimis.lib
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Makefile CI Tests (C++20)

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Update package list
run: sudo apt-get update

- name: Install dependencies
run: sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libglew-dev

- name: Build
run: make CPP_20=1 -Csrc -j4

- name: Move library to ld path
run: sudo cp src/libprimis.so /usr/lib/libprimis.so

- name: Build test code
run: cd test && make

- name: Run tests
run: cd test && ./libprimis_testsuite
24 changes: 16 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@
bin_unix/*
src/tess_client
src/tess_server
test/libprimis_testsuite
.idea/
*.gcov
*.gcda
*.gcno
*.srctrldb
*.srctrlbm
*.srctrlprj
# Files auto-produced by VSCode.
.vscode/
.ionide/
.ionide
# Files auto-produced by CMake
cmake-build-*/
# Documentation files in the docs folder.
docs
# zig build files
src/zig-out
src/zig-cache

.fake
# C/C++ language server cache.
.ccls-cache/
# Ignore Code Spell Checker plugin files.
cspell.json
# Ignore html folder produced by Doxygen/Doxywizard.
html/
# Ignore common IDE/code editor directories
.vscode/
src/vcpp/.vs/
src/vcpp/Release64/
src/vcpp/libprimis.vcxproj.user
.clangd
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/libprimis.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ agent:
type: e1-standard-2
os_image: ubuntu2004
blocks:
- name: 'Block #1'
- name: Building
task:
jobs:
- name: 'Job #1'
- name: Clean and production build
commands:
- checkout
- sem-version cpp 9
- sudo apt-get update
- sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libglew-dev
- git submodule update --init --remote src/libprimis-headers
- make -C src clean
- make -C src -j3
- cmake --configure .
- cmake --build . --clean-first
dependencies: []
- name: Testing
dependencies: []
Expand Down
Loading

0 comments on commit 9d25be5

Please sign in to comment.