Skip to content

Try running the tests this way and checking to see if this produces a… #130

Try running the tests this way and checking to see if this produces a…

Try running the tests this way and checking to see if this produces a… #130

Workflow file for this run

# I have no idea what I'm doing
name: Build Gem
on:
push:
branches: ['dev', 'build-gem']
tags: ['*']
paths-ignore: ['*.md', '*.json', '*.png']
pull_request:
branches: ['dev', 'build-gem']
paths-ignore: ['*.md', '*.json', '*.png']
jobs:
build-windows:
name: Windows
runs-on: windows-latest
strategy:
matrix:
include:
- { ruby: '3.1', sys: ucrt64, env: ucrt-x86_64, clib: ucrt }
fail-fast: false
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: >-
base-devel
git
vim
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-meson
mingw-w64-${{matrix.env}}-autotools
mingw-w64-${{matrix.env}}-gcc
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
windows/build-mingw64
windows/downloads
key: win-gem-${{matrix.ruby}}-${{ hashFiles('windows/Makefile') }}
- name: Build all dependencies
shell: msys2 {0}
run: |
cd windows
make
- name: Build Ruby gem
shell: msys2 {0}
run: |
source windows/vars.sh
meson build -Dbuild_gem=true
cd build
ninja install
cd ..
gem build mkxp-z
- name: Start Audio Service
run: net start audiosrv
- name: Create Fake Audio Device
uses: LABSN/sound-ci-helpers@v1
- name: Install Mesa
shell: cmd
run: |
curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/20.3.2/mesa3d-20.3.2-release-msvc.7z
"C:\Program Files\7-Zip\7z.exe" x mesa.7z
mklink opengl32.dll "x64\opengl32.dll"
mklink libglapi.dll "x64\libglapi.dll"
- name: Run Tests
run: rake --trace
- 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_gem_windows
- name: Ruby Gem Setup Credentials
if: github.ref == 'refs/heads/dev'
uses: fac/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push Gem to Registry
if: github.ref == 'refs/heads/dev'
run: |
$gemfile = @(gci mkxp-z-*.gem | Resolve-Path -Relative)[0]
gem push --key github --host https://rubygems.pkg.github.com/fcorso2016 "${gemfile}"
- name: Prepare archive
shell: msys2 {0}
run: |
mkdir build/artifact
cd build/artifact
cp /${{ matrix.sys }}/bin/zlib1.dll .
cp ../../mkxp-z-*.gem .
cp ../../mkxp.json .
cp -r ../../scripts .
cp -r ../../tests .
- uses: actions/upload-artifact@v3
with:
name: mkxp-z.windows.gem.${{matrix.ruby}}.${{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/*.gem
build/artifact/mkxp.json
build/artifact/scripts/
build-linux:
name: Ubuntu 22.04
runs-on: ubuntu-22.04
strategy:
matrix:
ruby: ['3.1']
fail-fast: false
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-gem-${{matrix.ruby}}.-${{ hashFiles('linux/Makefile') }}
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install git build-essential cmake meson autoconf automake libtool pkg-config bison zlib1g-dev libbz2-dev xorg-dev libgl1-mesa-dev libasound2-dev libpulse-dev -y
- name: Build everything else
env:
CMAKE_EXTRA_ARGS: -DCMAKE_POSITION_INDEPENDENT_CODE=ON
EXTRA_CONFIG_OPTIONS: --with-pic
run: |
cd linux
make
- name: Build Ruby gem
run: |
source linux/vars.sh
meson build --bindir=. --prefix=$GITHUB_WORKSPACE/build/local -Dbuild_gem=true
cd build
ninja
ninja install
cd ..
gem build mkxp-z.gemspec
- name: Create Fake Audio Device
uses: LABSN/sound-ci-helpers@v1
- name: Run Tests
run: rake --trace
- 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_gem_linux
- name: Ruby Gem Setup Credentials
if: github.ref == 'refs/heads/dev'
uses: fac/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push Gem to Registry
if: github.ref == 'refs/heads/dev'
run: |
GEMFILES=(mkxp-z-*.gem)
gem push --key github --host https://rubygems.pkg.github.com/fcorso2016 "${GEMFILES[0]}"
- name: Prepare archive
run: |
cd build/local
cp ../../mkxp-z-*.gem .
cp ../../mkxp.json .
cp -r ../../scripts .
cd ..
zip -r local.zip local
- uses: actions/upload-artifact@v3
with:
name: mkxp-z.linux.${{matrix.ruby}}.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}}
path: build/local.zip