Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI and few other things #9

Open
wants to merge 8 commits into
base: new
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 42 additions & 43 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

matrix:
Expand All @@ -35,7 +34,7 @@ jobs:
bin-path: "src/build/Release/SvenBXT.dll"
toolchain-file: ""
cmake-generator: "Visual Studio 17 2022"
build-target: "-A Win32" # HACK, but I have no idea how to do it
permanentdaylightt marked this conversation as resolved.
Show resolved Hide resolved
build-target: "-A Win32"
- os: ubuntu-20.04
c_compiler: gcc
cpp_compiler: g++
Expand All @@ -51,56 +50,56 @@ jobs:
c_compiler: cl

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout submodules
shell: bash
run: git submodule update --init --recursive
- name: Checkout submodules
shell: bash
run: git submodule update --init --recursive

- 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 }}/src/build" >> "$GITHUB_OUTPUT"
echo "src-dir=${{ github.workspace }}/src" >> "$GITHUB_OUTPUT"
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/src/build" >> "$GITHUB_OUTPUT"
echo "src-dir=${{ github.workspace }}/src" >> "$GITHUB_OUTPUT"

- name: Add MSBuild to PATH
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.0.2
- name: Add MSBuild to PATH
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2

- name: Install Ubuntu packages
if: runner.os == 'Linux'
run: |
- name: Install Ubuntu packages
if: runner.os == 'Linux'
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -y build-essential libc6:i386 g++-multilib mesa-common-dev libgl-dev:i386 libgl1-mesa-dev

- name: Configure CMake
run: >
cmake -G "${{ matrix.cmake-generator }}"
${{ matrix.build-target }}
-B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain-file }}
-DFUNCHOOK_BUILD_TESTS=OFF
-S ${{ steps.strings.outputs.src-dir }}
- name: Configure CMake
run: >
cmake -G "${{ matrix.cmake-generator }}"
${{ matrix.build-target }}
-B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain-file }}
-DFUNCHOOK_BUILD_TESTS=OFF
-S ${{ steps.strings.outputs.src-dir }}

- name: Build (Linux)
if: runner.os == 'Linux'
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Build Linux version
if: runner.os == 'Linux'
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

- name: Build (Windows)
if: runner.os == 'Windows'
run: msbuild /m /p:OutputPath=${{ steps.strings.outputs.build-output-dir }} /p:Configuration=${{ matrix.build_type }} ${{ steps.strings.outputs.build-output-dir }}/SvenBXT.sln
- name: Build Windows version
if: runner.os == 'Windows'
run: msbuild /m /p:OutputPath=${{ steps.strings.outputs.build-output-dir }} /p:Configuration=${{ matrix.build_type }} ${{ steps.strings.outputs.build-output-dir }}/SvenBXT.sln

- name: Prepare artifacts
run: mkdir -p bin && mv ${{ matrix.bin-path }} bin/
- name: Prepare artifacts
run: mkdir -p bin && mv ${{ matrix.bin-path }} bin/

- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
path: ./bin
name: ${{ matrix.artifact }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
path: ./bin
name: ${{ matrix.artifact }}
41 changes: 31 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
.idea/
.vs/
_build/
_build_WIN32/
build/
src/.idea/
src/.vs/
src/_build/
src/_build_WIN32/
src/build/
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
Loading