psp.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. name: Build (Sony Playstation Portable)
  2. on: [push, pull_request]
  3. concurrency:
  4. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
  5. cancel-in-progress: true
  6. jobs:
  7. psp:
  8. runs-on: ubuntu-latest
  9. container: pspdev/pspdev:latest
  10. steps:
  11. - uses: actions/checkout@v4
  12. - name: Setup dependencies
  13. run: |
  14. apk update
  15. apk add cmake gmp mpc1 mpfr4 make pkgconf
  16. - name: Pollute PSP SDK with "bad" SDL headers
  17. run: |
  18. # Create "bad" SDL headers in the PSP SDK.
  19. # SDL sources should not use these.
  20. infixes=". psp psp/sdk"
  21. for infix in $infixes; do
  22. directory="$PSPDEV/$infix/include/SDL3"
  23. echo "Creating directory $directory"
  24. mkdir -p "$directory"
  25. for include in include/SDL3/*.h; do
  26. dest="$PSPDEV/$infix/include/SDL3/$(basename "$include")"
  27. echo "Creating $dest"
  28. echo '#error "System SDL headers must not be used by build system"' >"$dest"
  29. done
  30. done
  31. - name: Configure (CMake)
  32. run: |
  33. cmake -S . -B build \
  34. -Wdeprecated -Wdev -Werror \
  35. -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
  36. -DSDL_WERROR=ON \
  37. -DSDL_TESTS=ON \
  38. -DSDL_INSTALL_TESTS=ON \
  39. -DSDL_DISABLE_INSTALL_DOCS=OFF \
  40. -DCMAKE_BUILD_TYPE=Release \
  41. -DCMAKE_INSTALL_PREFIX=prefix
  42. - name: Build (CMake)
  43. run: cmake --build build --config Release --verbose
  44. - name: Install (CMake)
  45. run: |
  46. echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  47. cmake --install build --config Release
  48. ( cd prefix; find ) | LC_ALL=C sort -u
  49. - name: Package (CPack)
  50. run: |
  51. cmake --build build/ --config Release --target package
  52. - name: Verify CMake configuration files
  53. run: |
  54. cmake -S cmake/test -B cmake_config_build \
  55. -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
  56. -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
  57. -DTEST_SHARED=FALSE \
  58. -DCMAKE_BUILD_TYPE=Release
  59. cmake --build cmake_config_build --verbose
  60. - name: Verify sdl3.pc
  61. run: |
  62. export CC=psp-gcc
  63. export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
  64. export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
  65. cmake/test/test_pkgconfig.sh
  66. - uses: actions/upload-artifact@v4
  67. with:
  68. if-no-files-found: error
  69. name: SDL-psp
  70. path: build/dist/SDL3*