mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 00:56:40 -04:00
Merge pull request #909 from SpiralP/add-github-actions
add GitHub Actions ci workflow for test-building linux, windows, and mac
This commit is contained in:
commit
aa3fecb80b
137
.github/workflows/build.yml
vendored
Normal file
137
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
name: Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build_on_ubuntu:
|
||||
name: Build ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit) on Ubuntu
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- { plat: "Linux", bits: 64 }
|
||||
- { plat: "Linux", bits: 32 }
|
||||
- { plat: "Windows", bits: 64 }
|
||||
- { plat: "Windows", bits: 32 }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Shared Dependencies
|
||||
run: |
|
||||
sudo apt-get -y update &&
|
||||
sudo apt-get -y install build-essential
|
||||
|
||||
# Install platform specific dependencies
|
||||
- name: Install Dependencies for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Linux' && matrix.config.bits == 64
|
||||
run: |
|
||||
sudo apt-get -y install libx11-dev libxi-dev libgl1-mesa-dev
|
||||
|
||||
- name: Install Dependencies for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Linux' && matrix.config.bits == 32
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386 \
|
||||
&& sudo apt-get -y update \
|
||||
&& sudo apt-get -y install gcc-multilib libx11-dev:i386 libxi-dev:i386 libgl1-mesa-dev:i386
|
||||
|
||||
- name: Install Dependencies for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Windows' && matrix.config.bits == 64
|
||||
run: |
|
||||
sudo apt-get -y install gcc-mingw-w64-x86-64
|
||||
|
||||
- name: Install Dependencies for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Windows' && matrix.config.bits == 32
|
||||
run: |
|
||||
sudo apt-get -y install gcc-mingw-w64-i686
|
||||
|
||||
# Build
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Linux' && matrix.config.bits == 64
|
||||
run: |
|
||||
cd src
|
||||
make linux
|
||||
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Linux' && matrix.config.bits == 32
|
||||
run: |
|
||||
cd src
|
||||
# Note, this overwrites the previous flags
|
||||
make linux CFLAGS="-m32" LDFLAGS="-m32"
|
||||
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Windows' && matrix.config.bits == 64
|
||||
run: |
|
||||
cd src
|
||||
make mingw CC="x86_64-w64-mingw32-gcc"
|
||||
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Windows' && matrix.config.bits == 32
|
||||
run: |
|
||||
cd src
|
||||
make mingw CC="i686-w64-mingw32-gcc"
|
||||
|
||||
build_on_windows:
|
||||
name: Build ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit) on Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- { plat: "Windows", bits: 64 }
|
||||
- { plat: "Windows", bits: 32 }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
|
||||
# Build
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Windows' && matrix.config.bits == 64
|
||||
run: |
|
||||
msbuild src\ClassiCube.vcxproj `
|
||||
-property:Configuration=Debug -property:Platform=x64 `
|
||||
-property:WindowsTargetPlatformVersion=10 -property:PlatformToolset=v142
|
||||
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Windows' && matrix.config.bits == 32
|
||||
run: |
|
||||
msbuild src\ClassiCube.vcxproj `
|
||||
-property:Configuration=Debug -property:Platform=Win32 `
|
||||
-property:WindowsTargetPlatformVersion=10 -property:PlatformToolset=v142
|
||||
|
||||
build_on_mac:
|
||||
name: Build ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit) on Mac
|
||||
runs-on: macOS-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- { plat: "Mac", bits: 64 }
|
||||
# "ld: warning: ignoring file ..., missing required architecture i386 in file ..."
|
||||
# "Undefined symbols for architecture i386"
|
||||
# - { plat: "Mac", bits: 32 }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Build
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Mac' && matrix.config.bits == 64
|
||||
run: |
|
||||
cd src
|
||||
# fix for "error: implicit declaration of function 'CGDisplayBitsPerPixel'"
|
||||
sed -i '' 's|#include <Cocoa/Cocoa.h>|&\'$'\nextern size_t CGDisplayBitsPerPixel(CGDirectDisplayID display);|' interop_cocoa.m
|
||||
make mac_x64
|
||||
|
||||
- name: Build for ${{ matrix.config.plat }} (${{ matrix.config.bits }} bit)
|
||||
if: matrix.config.plat == 'Mac' && matrix.config.bits == 32
|
||||
run: |
|
||||
cd src
|
||||
make mac_x32
|
@ -21,7 +21,7 @@ ROOT_DIR=~/client # can be changed
|
||||
ALL_FLAGS="-O1 -s -fno-stack-protector -fno-math-errno -Qn -w"
|
||||
|
||||
# log file that errors are written to
|
||||
ERR_FILES=$ROOT_DIR/cc_errors.txt
|
||||
ERRS_FILE=$ROOT_DIR/cc_errors.txt
|
||||
rm "$ERRS_FILE"
|
||||
|
||||
# ----------------------------- compile windows
|
||||
@ -213,4 +213,4 @@ run_timed build_rpi
|
||||
run_timed build_android
|
||||
|
||||
cd ~
|
||||
python3 notify.py
|
||||
python3 notify.py
|
||||
|
Loading…
x
Reference in New Issue
Block a user