mirror of
				https://github.com/N64Recomp/N64ModernRuntime.git
				synced 2025-10-30 08:02:29 +00:00 
			
		
		
		
	Add CI workflows (#21)
This commit is contained in:
		
							parent
							
								
									72bc656c5e
								
							
						
					
					
						commit
						3ddeb07d85
					
				
					 3 changed files with 110 additions and 2 deletions
				
			
		
							
								
								
									
										106
									
								
								.github/workflows/validate.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								.github/workflows/validate.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,106 @@ | |||
| name: validate | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|   pull_request: | ||||
|     types: [opened, synchronize] | ||||
| concurrency: | ||||
|   group: ${{ github.workflow }}-${{ github.ref }} | ||||
|   cancel-in-progress: true | ||||
| jobs: | ||||
|   build-linux: | ||||
|     runs-on: ${{ matrix.arch == 'x64' && 'ubuntu-22.04' || 'blaze/ubuntu-22.04' }} | ||||
|     strategy: | ||||
|       matrix: | ||||
|         type: [ Debug, Release ] | ||||
|         os: [ ubuntu-22.04 ] | ||||
|         arch: [ x64, arm64 ] | ||||
|     name: ${{ matrix.os }} (${{ matrix.arch }}, ${{ matrix.type }}) | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|         with: | ||||
|           ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||||
|           submodules: recursive | ||||
|       - name: ccache | ||||
|         uses: hendrikmuhs/ccache-action@v1.2 | ||||
|         with: | ||||
|           key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }}-${{ matrix.arch }} | ||||
|       - name: Install Linux Dependencies | ||||
|         if: runner.os == 'Linux' | ||||
|         run: | | ||||
|           sudo apt-get update | ||||
|           sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 | ||||
|            | ||||
|           # Install SDL2 | ||||
|           echo ::group::install SDL2 | ||||
| 
 | ||||
|           # Enable ccache | ||||
|           export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||||
| 
 | ||||
|           wget https://www.libsdl.org/release/SDL2-2.26.1.tar.gz | ||||
|           tar -xzf SDL2-2.26.1.tar.gz | ||||
|           cd SDL2-2.26.1 | ||||
|           ./configure | ||||
|           make -j 10 | ||||
|           sudo make install | ||||
|           sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ | ||||
|           echo ::endgroup:: | ||||
|       - name: Generate CMake Project | ||||
|         if: runner.os != 'Windows' | ||||
|         run: | | ||||
|           # enable ccache | ||||
|           export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"           | ||||
|           cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build | ||||
|       - name: Build ultramodern | ||||
|         run: | | ||||
|           # enable ccache | ||||
|           export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||||
|           cmake --build cmake-build --config ${{ matrix.type }} --target ultramodern -j $(nproc) | ||||
|       - name: Build librecomp | ||||
|         run: | | ||||
|           # enable ccache | ||||
|           export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||||
|           cmake --build cmake-build --config ${{ matrix.type }} --target librecomp -j $(nproc) | ||||
|   build-windows: | ||||
|     runs-on: windows-latest | ||||
|     strategy: | ||||
|       matrix: | ||||
|         type: [ Debug, Release ] | ||||
|     name: windows (${{ matrix.type }}) | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
|         with: | ||||
|           ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||||
|           submodules: recursive | ||||
|       - name: ccache | ||||
|         uses: hendrikmuhs/ccache-action@v1.2 | ||||
|         with: | ||||
|           key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }} | ||||
|       - name: Install Windows Dependencies | ||||
|         run: | | ||||
|           choco install ninja | ||||
|           Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue | ||||
|       - name: Configure Developer Command Prompt | ||||
|         uses: ilammy/msvc-dev-cmd@v1 | ||||
|       - name: Generate CMake Project | ||||
|         run: | | ||||
|           # enable ccache | ||||
|           set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" | ||||
|           cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build -DCMAKE_CXX_FLAGS="-Xclang -fcxx-exceptions" | ||||
|       - name: Build ultramodern | ||||
|         run: | | ||||
|           # enable ccache | ||||
|           set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" | ||||
|           $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors | ||||
| 
 | ||||
|           cmake --build cmake-build --config ${{ matrix.type }} --target ultramodern -j $cpuCores | ||||
|       - name: Build librecomp | ||||
|         run: | | ||||
|           # enable ccache | ||||
|           set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" | ||||
|           $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors | ||||
| 
 | ||||
|           cmake --build cmake-build --config ${{ matrix.type }} --target librecomp -j $cpuCores | ||||
|  | @ -105,7 +105,7 @@ extern "C" void osContGetQuery_recomp(uint8_t * rdram, recomp_context * ctx) { | |||
| } | ||||
| 
 | ||||
| extern "C" void osContSetCh_recomp(uint8_t* rdram, recomp_context* ctx) { | ||||
|     max_controllers = std::min(_arg<0, u8>(rdram, ctx), u8(4)); | ||||
|     max_controllers = (std::min)(_arg<0, u8>(rdram, ctx), u8(4)); | ||||
|     _return<s32>(ctx, 0); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -8,9 +8,11 @@ | |||
| #include <fstream> | ||||
| #include <iostream> | ||||
| #include <optional> | ||||
| #include <mutex> | ||||
| #include <array> | ||||
| 
 | ||||
| #ifdef _WIN32 | ||||
| #include <Windows.h> | ||||
| #include <Shlobj.h> | ||||
| #elif defined(__linux__) | ||||
| #include <pwd.h> | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 David Chavez
						David Chavez