This repository was archived by the owner on Oct 11, 2024. It is now read-only.
Merge pull request #171 from igor725/playgo #969
This file contains hidden or 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
name: build | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
paths: | |
- '.github/workflows/build.yml' | |
- '**/CMakeLists.txt' | |
- 'CMakeLists.txt' | |
- '**.cmake' | |
- '**.cpp' | |
- '**.cxx' | |
- '**.cc' | |
- '**.c' | |
- '**.hpp' | |
- '**.hh' | |
- '**.h' | |
push: | |
paths: | |
- '.github/workflows/build.yml' | |
- '**/CMakeLists.txt' | |
- 'CMakeLists.txt' | |
- '**.cmake' | |
- '**.cpp' | |
- '**.cxx' | |
- '**.cc' | |
- '**.c' | |
- '**.hpp' | |
- '**.hh' | |
- '**.h' | |
jobs: | |
formatting-check: | |
permissions: | |
contents: write | |
name: Formatting check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Test formatting | |
uses: DoozyX/[email protected] | |
with: | |
source: ./ | |
extensions: h,hpp,cpp,c,cc | |
clangFormatVersion: 17 | |
inplace: true | |
- name: Generate patch file | |
run: | | |
git diff > formatting.patch | |
find *.patch -type f -size 0 -delete | |
- name: Upload patch | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-format | |
path: formatting.patch | |
- name: Error if fixed | |
run: | | |
if rm formatting.patch; then | |
echo "# Looks like you messed something up!" >> $GITHUB_STEP_SUMMARY | |
echo "1. Download the \`code-format\` artifact above" >> $GITHUB_STEP_SUMMARY | |
echo "2. Unpack the patch file" >> $GITHUB_STEP_SUMMARY | |
echo "3. Use \`git apply formatting.patch\` command to apply it to your repo" >> $GITHUB_STEP_SUMMARY | |
echo "4. Push the applied changes to your Pull Request" >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
fi | |
build: | |
needs: formatting-check | |
name: Emulator | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Detect MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86_64 | |
- name: Prepare Vulkan SDK | |
uses: humbletim/install-vulkan-sdk@c2aa128094d42ba02959a660f03e0a4e012192f9 | |
with: | |
version: 1.3.275.0 | |
cache: true | |
- name: Configure | |
run: | | |
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';' | |
echo "::add-matcher::tools/matchers/cmake.json" | |
cmake.exe -S. -B_build/_Release -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_build/_Install -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DTEST_BENCH=ON -DISACTION=1 | |
- name: Build | |
run: | | |
echo "::add-matcher::tools/matchers/cmake.json" | |
echo "::add-matcher::tools/matchers/compilers.json" | |
cmake --build _build/_Release -j4 | |
- name: Install | |
run: | | |
echo "::add-matcher::tools/matchers/cmake.json" | |
cmake.exe --install _build/_Release | |
- name: Run some tests | |
shell: bash | |
run: echo "`node misc/testRunner`" >> $GITHUB_STEP_SUMMARY | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: psOff-emu | |
path: | | |
_build/_Install/* | |
!_build/_Install/vulkan-1.dll | |
!_build/_Install/*_test.exe |