Try running the tests this way and checking to see if this produces a… #152
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have no idea what I'm doing | |
name: Automatic Build | |
on: | |
push: | |
branches: ['dev', 'autobuild'] | |
paths-ignore: ['*.md', '*.json', '*.png'] | |
pull_request: | |
branches: ['dev', 'autobuild'] | |
paths-ignore: ['*.md', '*.json', '*.png'] | |
jobs: | |
build-windows: | |
name: Windows | |
runs-on: windows-latest | |
steps: | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 7 | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: mingw64 | |
install: >- | |
base-devel | |
git | |
ruby | |
vim | |
mingw-w64-x86_64-cmake | |
mingw-w64-x86_64-meson | |
mingw-w64-x86_64-autotools | |
mingw-w64-x86_64-gcc | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
windows/build-mingw64 | |
windows/downloads | |
key: win-${{ hashFiles('windows/Makefile') }} | |
- name: Build all dependencies | |
shell: msys2 {0} | |
run: | | |
cd windows | |
make | |
- name: Build exe | |
shell: msys2 {0} | |
run: | | |
source windows/vars.sh | |
meson build | |
cd build | |
ninja | |
strip ./mkxp-z.exe | |
dirname $(where gcc) >> $GITHUB_PATH | |
- name: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarcloud-github-c-cpp@v2 | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner --define sonar.cfamily.compile-commands=build/compile_commands.json --define sonar.projectKey=fcorso2016_mkxp-z_exe_windows | |
- name: Prepare archive | |
shell: msys2 {0} | |
run: | | |
mkdir build/artifact | |
cd build/artifact | |
cp /mingw64/bin/zlib1.dll . | |
cp ../../windows/build-mingw64/bin/x64-msvcrt-ruby310.dll . | |
cp -r ../../windows/build-mingw64/lib/ruby/3.1.0 . | |
mv ./3.1.0 ./stdlib | |
cp ../mkxp-z.exe . | |
cp ../../mkxp.json . | |
cp -r ../../scripts . | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: mkxp-z.windows.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}} | |
path: | | |
build/artifact/*.dll | |
build/artifact/*.exe | |
build/artifact/mkxp.json | |
build/artifact/scripts/ | |
build/artifact/stdlib/ | |
build-linux: | |
name: Ubuntu 22.04 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 7 | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
linux/build-x86_64 | |
linux/downloads | |
key: lin-${{ hashFiles('linux/Makefile') }} | |
- name: Install apt dependencies | |
run: | | |
sudo apt update | |
sudo apt install git build-essential cmake meson autoconf automake libtool pkg-config ruby bison zlib1g-dev libbz2-dev xorg-dev libgl1-mesa-dev libasound2-dev libpulse-dev -y | |
- name: Build everything else | |
run: | | |
cd linux | |
make | |
- name: Build executable | |
run: | | |
source linux/vars.sh | |
meson build --bindir=. --prefix=$GITHUB_WORKSPACE/build/local | |
cd build | |
ninja | |
ninja install | |
- name: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarcloud-github-c-cpp@v2 | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner --define sonar.cfamily.compile-commands=build/compile_commands.json --define sonar.projectKey=fcorso2016_mkxp-z_exe_linux | |
- name: Prepare archive | |
run: | | |
cd build/local | |
cp -r ../../linux/build-x86_64/lib/ruby/3.1.0 . | |
mv ./3.1.0 ./stdlib | |
cp ../../mkxp.json . | |
cp -r ../../scripts . | |
cd .. | |
zip -r local.zip local | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: mkxp-z.linux.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}} | |
path: build/local.zip | |
build-macos: | |
name: macOS | |
runs-on: macos-latest | |
env: | |
BUILD_WRAPPER_OUT_DIR: bw_output | |
steps: | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 7 | |
- name: Remove pre-existing homebrew packages | |
run: brew remove --force $(brew list) | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
macos/Dependencies/build-macosx-x86_64 | |
macos/Dependencies/build-macosx-arm64 | |
macos/Dependencies/build-macosx-universal | |
macos/Dependencies/downloads | |
key: mac-${{ hashFiles('macos/Dependencies/*.make', 'macos/Dependencies/*.sh') }} | |
- name: Install Homebrew tools | |
run: | | |
cd macos/Dependencies | |
brew bundle | |
- name: Build all dependencies | |
run: | | |
cd macos/Dependencies | |
./setup.sh | |
- name: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarcloud-github-c-cpp@v2 | |
- name: Build app | |
run: | | |
cd macos | |
build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} xcodebuild -project mkxp-z.xcodeproj -configuration "Release" -scheme "Universal" -derivedDataPath "$GITHUB_WORKSPACE/build" | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner --define sonar.cfamily.build-wrapper-output="macos/${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.projectKey=fcorso2016_mkxp-z_exe_mac | |
- name: Compress app | |
run: | | |
cd build/Build/Products/Release | |
ditto -c -k --sequesterRsrc --keepParent Z-universal.app Z-universal.app.zip | |
- name: Upload archive | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mkxp-z.macos.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}} | |
path: build/Build/Products/Release/Z-universal.app.zip |