Repository navigation
ci: run dynarmic unit tests #525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ymatrix1
wants to merge
2
commits into
Eglantine-Community:nx2
Choose a base branch
from
ymatrix1:ci/dynarmic-tests
base: nx2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| name: dynarmic-tests | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: &paths | ||
| - "src/dynarmic/**" | ||
| - "CMakeLists.txt" | ||
| - "src/CMakeLists.txt" | ||
| - "CMakeModules/**" | ||
| - ".patch/**" | ||
| - "externals/CMakeLists.txt" | ||
| - "cpmfile.json" | ||
| - ".github/workflows/dynarmic-tests.yml" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| push: | ||
| branches: | ||
| - nx2 | ||
| paths: *paths | ||
| schedule: | ||
| - cron: "0 4 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: dynarmic-tests-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| dynarmic: | ||
| name: dynarmic unit tests | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 90 | ||
| env: | ||
| CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
| CCACHE_MAXSIZE: 1000M | ||
| CPM_SOURCE_CACHE: ${{ github.workspace }}/.cache/cpm | ||
| steps: | ||
| - name: Check out source | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| autoconf cmake g++ gcc git glslang-tools libglu1-mesa-dev \ | ||
| libpulse-dev libtool libudev-dev mesa-common-dev nasm ninja-build \ | ||
| libavfilter-dev libavcodec-dev libswscale-dev pkg-config zlib1g-dev \ | ||
| libva-dev libvdpau-dev spirv-tools spirv-headers libusb-1.0-0-dev \ | ||
| libboost-dev libboost-fiber-dev libboost-context-dev \ | ||
| libopus-dev libasound2-dev ccache catch2 mold | ||
|
|
||
| # Informational only: the x64 backend picks AVX-512 code paths from the host CPU, and | ||
| # hosted runners vary. This lists what the host offers; it does not say what the tests ran. | ||
| # The A64 CLZ 16-bit path needs avx512vl and avx512cd as well as avx512f. Never fails. | ||
| - name: Report host CPU features | ||
| run: | | ||
| uname -m | ||
| grep -m1 'model name' /proc/cpuinfo || true | ||
| echo "AVX-512 flags:" | ||
| grep -o 'avx512[a-z_0-9]*' /proc/cpuinfo | sort -u || echo "(none)" | ||
| if grep -q avx512f /proc/cpuinfo && grep -q avx512vl /proc/cpuinfo && grep -q avx512cd /proc/cpuinfo; then | ||
| echo "::notice::host offers avx512f, avx512vl and avx512cd, the features the AVX-512 CLZ path needs" | ||
| else | ||
| echo "::notice::host lacks avx512f, avx512vl or avx512cd, so the AVX-512 CLZ path is not available to this run" | ||
| fi | ||
| true | ||
|
|
||
| - name: Restore ccache | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .ccache | ||
| key: dynarmic-tests-${{ github.sha }} | ||
| restore-keys: dynarmic-tests- | ||
|
|
||
| - name: Restore dependency sources | ||
| id: cpm | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .cache/cpm | ||
| # Exact key only: CPMUtil does not recheck a cached source's URL or hash. | ||
| key: cpm-${{ hashFiles('cpmfile.json', 'CMakeModules/**', '.patch/**') }} | ||
|
|
||
| # DYNARMIC_TESTS defaults to BUILD_TESTING, which the root build forces OFF, so it must be | ||
| # set explicitly. It also gates find_package(Catch2) and oaknut in externals. | ||
| - name: Configure | ||
| run: | | ||
| cmake -S . -B build -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \ | ||
| -DDYNARMIC_TESTS=ON \ | ||
| -DENABLE_QT=OFF \ | ||
| -DYUZU_CMD=OFF \ | ||
| -DYUZU_ROOM=OFF \ | ||
| -DYUZU_ROOM_STANDALONE=OFF \ | ||
| -DYUZU_USE_BUNDLED_SDL3=ON \ | ||
| -DVulkanHeaders_FORCE_BUNDLED=ON \ | ||
| -DVulkanUtilityLibraries_FORCE_BUNDLED=ON \ | ||
| -DENABLE_UPDATE_CHECKER=OFF \ | ||
| -DUSE_DISCORD_PRESENCE=OFF \ | ||
| -DENABLE_WERROR=OFF \ | ||
| -DUSE_CCACHE=ON | ||
|
|
||
| - name: Build dynarmic_tests | ||
| run: | | ||
| ccache -z | ||
| cmake --build build --target dynarmic_tests --parallel | ||
| ccache -s | ||
|
|
||
| - name: Run dynarmic tests | ||
| run: | | ||
| BIN=$(find build -type f -name dynarmic_tests -perm -u+x | head -n1) | ||
| test -n "$BIN" || { echo "::error::dynarmic_tests binary not found"; exit 1; } | ||
| echo "Running $BIN" | ||
| "$BIN" --durations yes | ||
|
|
||
| - name: Save ccache | ||
| if: ${{ always() && github.ref == 'refs/heads/nx2' }} | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: .ccache | ||
| key: dynarmic-tests-${{ github.sha }} | ||
|
|
||
| - name: Save dependency sources | ||
| if: ${{ always() && github.ref == 'refs/heads/nx2' && steps.cpm.outputs.cache-hit != 'true' }} | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: .cache/cpm | ||
| key: cpm-${{ hashFiles('cpmfile.json', 'CMakeModules/**', '.patch/**') }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include
externals/cmake-modules/**in the path filter.CMakeLists.txtadds this directory toCMAKE_MODULE_PATHand loadsDetectArchitectureandDetectPlatformfrom it. Changes there do not matchCMakeModules/**, so affected pull requests andnx2pushes can skip this workflow. Addexternals/cmake-modules/**to the sharedpathslist. (raw.githubusercontent.com)