WIP cache #142
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 and Test | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'master' | |
| paths-ignore: | |
| - 'README*.md' | |
| jobs: | |
| linux: | |
| name: "Linux build" | |
| runs-on: ubuntu-slim | |
| env: | |
| PREFIX: "/usr" | |
| PY3PATH: "" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Launchpad PPA | |
| id: launchpad_ppa | |
| run: | | |
| sudo add-apt-repository -y ppa:dciabrin/ngdevkit | |
| sudo apt-get update -y | |
| toolchain_version=$(sudo apt-cache policy ngdevkit-toolchain | awk '/Candidate:/ {print $2}') | |
| arch=$(dpkg --print-architecture) | |
| echo "toolchain_deb=ngdevkit-toolchain_${toolchain_version}_${arch}.deb" >> "$GITHUB_OUTPUT" | |
| - name: Cache ngdevkit-toolchain package | |
| uses: actions/cache@v5 | |
| with: | |
| path: /tmp/${{ steps.launchpad_ppa.outputs.toolchain_deb }} | |
| key: ${{ steps.launchpad_ppa.outputs.toolchain_deb }} | |
| - name: Prepare cached dependency | |
| run: | | |
| if [ ! -f /tmp/${{ steps.launchpad_ppa.outputs.toolchain_deb }} ]; then | |
| cd /tmp && sudo apt-get download ngdevkit-toolchain | |
| fi | |
| sudo cp /tmp/${{ steps.launchpad_ppa.outputs.toolchain_deb }} /var/cache/apt/archives | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install -y ngdevkit-toolchain python3 zip pkg-config | |
| - name: Build ngdevkit | |
| run: ./.github/scripts/build.sh | |
| - name: Install dependencies for ngdevkit-examples | |
| run: > | |
| sudo apt-get install -y python3-yaml ngdevkit-gngeo python3-pygame imagemagick | |
| sox libsox-fmt-mp3 libglew-dev libsdl2-dev | |
| - name: Test by compiling ngdevkit-examples | |
| run: ./.github/scripts/test.sh | |
| # win: | |
| # name: "Windows native MSYS2 build" | |
| # runs-on: windows-latest | |
| # env: | |
| # PY3PATH: "" | |
| # defaults: | |
| # run: | |
| # shell: msys2 {0} | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - name: Install MSYS2 | |
| # uses: msys2/setup-msys2@v2 | |
| # with: | |
| # msystem: UCRT64 | |
| # update: true | |
| # install: | |
| # git autoconf automake make zip | |
| # mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-python | |
| # mingw-w64-ucrt-x86_64-python-pygame | |
| # - name: Install ngdevkit dependencies | |
| # run: | | |
| # echo -e "[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf | |
| # pacman -Sy | |
| # pacman -S --disable-download-timeout --noconfirm mingw-w64-ucrt-x86_64-ngdevkit-toolchain | |
| # - name: Build | |
| # run: ./.github/scripts/build-msys2.sh | |
| # macos: | |
| # name: "macOS build" | |
| # runs-on: macos-15 | |
| # env: | |
| # PREFIX: "/opt/homebrew" | |
| # PY3PATH: "/opt/homebrew/bin" | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v4 | |
| # - name: Dependencies | |
| # run: | | |
| # brew tap dciabrin/ngdevkit | |
| # brew install python3 --overwrite | |
| # brew install automake ngdevkit-toolchain zip pkg-config sdl2 sdl2_image | |
| # $(brew --prefix python)/libexec/bin/pip install pygame --break-system-packages | |
| # - name: Build | |
| # run: ./.github/scripts/build.sh | |
| # - name: Install dependencies for ngdevkit-examples | |
| # run: | | |
| # brew install ngdevkit-gngeo imagemagick sox glew make | |
| # $(brew --prefix python)/libexec/bin/pip install pyyaml --break-system-packages | |
| # - name: Test by compiling ngdevkit-examples | |
| # run: ./.github/scripts/test.sh |