psp.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_EXAMPLES=ON \
  40. -DSDL_DISABLE_INSTALL_DOCS=OFF \
  41. -DCMAKE_BUILD_TYPE=Release \
  42. -DCMAKE_INSTALL_PREFIX=prefix
  43. - name: Build (CMake)
  44. run: cmake --build build --config Release --verbose
  45. - name: Install (CMake)
  46. run: |
  47. echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  48. cmake --install build --config Release
  49. ( cd prefix; find ) | LC_ALL=C sort -u
  50. - name: Package (CPack)
  51. run: |
  52. cmake --build build/ --config Release --target package
  53. - name: Verify CMake configuration files
  54. run: |
  55. cmake -S cmake/test -B cmake_config_build \
  56. -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
  57. -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
  58. -DTEST_SHARED=FALSE \
  59. -DCMAKE_BUILD_TYPE=Release
  60. cmake --build cmake_config_build --verbose
  61. - name: Verify sdl3.pc
  62. run: |
  63. export CC=psp-gcc
  64. export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
  65. export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
  66. cmake/test/test_pkgconfig.sh
  67. - uses: actions/upload-artifact@v4
  68. with:
  69. if-no-files-found: error
  70. name: SDL-psp
  71. path: build/dist/SDL3*