Skip to content
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

Split examples #803

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/Emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Checkout Examples
uses: actions/checkout@v3
with:
repository: 32blit/32blit-examples
path: 32blit-examples

- name: Install deps
run: |
sudo apt update && sudo apt install doxygen graphviz python3-setuptools
Expand Down Expand Up @@ -50,7 +56,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: emcmake cmake $GITHUB_WORKSPACE -D32BLIT_DIR=$GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG"
run: emcmake cmake $GITHUB_WORKSPACE/32blit-examples -D32BLIT_DIR=$GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG"

# Problem matching
- uses: ammaraskar/gcc-problem-matcher@master
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/Visual Studio.yml

This file was deleted.

40 changes: 27 additions & 13 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- os: ubuntu-20.04
name: Linux
cache-key: linux
release-suffix: LIN64
artifact-suffix: LIN64
cmake-args: '"-DCMAKE_CXX_CLANG_TIDY=clang-tidy;-header-filter=(32blit|32blit-sdl)/;-checks=performance-*,portability-*,modernize-*,-modernize-use-trailing-return-type,-modernize-avoid-c-arrays,-modernize-use-nodiscard" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache'
apt-packages: ccache clang-tidy libsdl2-dev libsdl2-image-dev libsdl2-net-dev python3-setuptools

Expand All @@ -36,8 +36,8 @@ jobs:
pico-sdk: true
name: PicoSystem
cache-key: picosystem
release-suffix: PicoSystem
cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE -DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_BOARD=pimoroni_picosystem -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
artifact-suffix: PicoSystem
cmake-args: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/pico.toolchain -DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_BOARD=pimoroni_picosystem -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
apt-packages: ccache gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools

- os: ubuntu-20.04
Expand All @@ -56,7 +56,7 @@ jobs:
- os: windows-latest
name: Visual Studio
cache-key: windows
release-suffix: WIN64
artifact-suffix: WIN64
cmake-args: -DSDL2_DIR=$GITHUB_WORKSPACE/vs/sdl

runs-on: ${{matrix.os}}
Expand All @@ -68,6 +68,12 @@ jobs:
- name: Checkout 32Blit SDK
uses: actions/checkout@v3

- name: Checkout Examples
uses: actions/checkout@v3
with:
repository: 32blit/32blit-examples
path: 32blit-examples

# pico sdk/extras for some builds
- name: Checkout Pico SDK
if: matrix.pico-sdk
Expand Down Expand Up @@ -121,7 +127,9 @@ jobs:
run: ci/install_sdl_mingw.sh

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
run: |
cmake -E make_directory ${{runner.workspace}}/build
cmake -E make_directory ${{runner.workspace}}/build-examples

- name: Set Tag Variable
if: github.event_name == 'release'
Expand Down Expand Up @@ -149,19 +157,25 @@ jobs:
cmake --build . --config $BUILD_TYPE -j 2
ccache --show-stats || true

#- name: Test
# working-directory: ${{runner.workspace}}/build
# shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C $BUILD_TYPE
- name: Configure Examples
shell: bash
working-directory: ${{runner.workspace}}/build-examples
# installs into same dir as SDK
run: cmake $GITHUB_WORKSPACE/32blit-examples -D32BLIT_DIR=$GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$RUNNER_WORKSPACE/build/install -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}}

- name: Build Examples
working-directory: ${{runner.workspace}}/build-examples
shell: bash
run: |
cmake --build . --config $BUILD_TYPE -j 2
ccache --show-stats || true

- name: Prepare Artifact
if: github.event_name != 'release'
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --config $BUILD_TYPE --target install
cmake --build $RUNNER_WORKSPACE/build --config $BUILD_TYPE --target install
cmake --build $RUNNER_WORKSPACE/build-examples --config $BUILD_TYPE --target install

- name: Upload Artifact
if: github.event_name != 'release'
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else()
endif()

find_package (32BLIT CONFIG REQUIRED PATHS .)
add_subdirectory(examples)
add_subdirectory(utilities)

add_subdirectory(launcher-shared)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The `32blit-stm32` directory contains the STM32 HAL for 32blit, compatible with

## Examples / Projects

The `examples` directory contains example projects, these can be built into both SDL or STM32 binaries and cover a range of techniques from simple concepts to complete games.
Examples can be found at https://github.com/32blit/32blit-examples/, these can be built into both SDL or STM32 binaries and cover a range of techniques from simple concepts to complete games.

Refer to the OS/platform specific documentation files in the `docs/` folder for instructions on how to compile and run these examples.

Expand Down
13 changes: 0 additions & 13 deletions assets/README.md

This file was deleted.

Binary file removed assets/gadgetoid_raycaster.png
Binary file not shown.
144 changes: 0 additions & 144 deletions assets/platformer.tmx

This file was deleted.

4 changes: 0 additions & 4 deletions assets/platformer.tsx

This file was deleted.

Binary file removed assets/s4m_ur4i-dingbads.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-pirate-characters.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-pirate-tilemap.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-platformer.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-space-shooter-backdrop-palette.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-space-shooter-backdrop.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-space-shooter-ships.png
Binary file not shown.
Binary file removed assets/s4m_ur4i-top-down-shooter.png
Binary file not shown.
Loading