Skip to content

Commit bc1362e

Browse files
committed
WIP cache
1 parent f135feb commit bc1362e

1 file changed

Lines changed: 84 additions & 64 deletions

File tree

.github/workflows/build-tests.yaml

Lines changed: 84 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,88 +8,108 @@ on:
88
jobs:
99
linux:
1010
name: "Linux build"
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-slim
1212
env:
1313
PREFIX: "/usr"
1414
PY3PATH: ""
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4
1818

19-
- name: Install dependencies
19+
- name: Set up Launchpad PPA
20+
id: launchpad_ppa
2021
run: |
21-
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
2222
sudo apt-get update -y
23-
sudo apt-get install -y ngdevkit-toolchain python3 zip pkg-config
23+
toolchain_version=$(sudo apt-cache policy sox | awk '/Candidate:/ {print $2}')
24+
arch=$(dpkg --print-architecture)
25+
echo "toolchain_deb=sox_${toolchain_version}_${arch}.deb" >> "$GITHUB_OUTPUT"
2426
25-
- name: Build ngdevkit
26-
run: ./.github/scripts/build.sh
27+
- name: Cache ngdevkit-toolchain package
28+
uses: actions/cache@v5
29+
with:
30+
path: /tmp/${{ steps.launchpad_ppa.outputs.toolchain_deb }}
31+
key: ${{ steps.launchpad_ppa.outputs.toolchain_deb }}
2732

28-
- name: Install dependencies for ngdevkit-examples
29-
run: >
30-
sudo apt-get install -y python3-yaml ngdevkit-gngeo python3-pygame imagemagick
31-
sox libsox-fmt-mp3 libglew-dev libsdl2-dev
33+
- name: Prepare cached dependency
34+
run: |
35+
if [ ! -f /tmp/${{ steps.launchpad_ppa.outputs.toolchain_deb }} ]; then
36+
cd /tmp && sudo apt-get download sox
37+
fi
38+
sudo cp /tmp/${{ steps.launchpad_ppa.outputs.toolchain_deb }} /var/cache/apt/archives
39+
40+
- name: Install dependencies
41+
run: |
42+
sudo apt-get install -y sox
43+
# sudo apt-get install -y ngdevkit-toolchain python3 zip pkg-config
3244
33-
- name: Test by compiling ngdevkit-examples
34-
run: ./.github/scripts/test.sh
45+
# - name: Build ngdevkit
46+
# run: ./.github/scripts/build.sh
3547

36-
win:
37-
name: "Windows native MSYS2 build"
38-
runs-on: windows-latest
39-
env:
40-
PY3PATH: ""
41-
defaults:
42-
run:
43-
shell: msys2 {0}
44-
steps:
45-
- name: Checkout
46-
uses: actions/checkout@v4
47-
with:
48-
fetch-depth: 0
48+
# - name: Install dependencies for ngdevkit-examples
49+
# run: >
50+
# sudo apt-get install -y python3-yaml ngdevkit-gngeo python3-pygame imagemagick
51+
# sox libsox-fmt-mp3 libglew-dev libsdl2-dev
4952

50-
- name: Install MSYS2
51-
uses: msys2/setup-msys2@v2
52-
with:
53-
msystem: UCRT64
54-
update: true
55-
install:
56-
git autoconf automake make zip
57-
mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-python
58-
mingw-w64-ucrt-x86_64-python-pygame
53+
# - name: Test by compiling ngdevkit-examples
54+
# run: ./.github/scripts/test.sh
5955

60-
- name: Install ngdevkit dependencies
61-
run: |
62-
echo -e "[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf
63-
pacman -Sy
64-
pacman -S --disable-download-timeout --noconfirm mingw-w64-ucrt-x86_64-ngdevkit-toolchain
56+
# win:
57+
# name: "Windows native MSYS2 build"
58+
# runs-on: windows-latest
59+
# env:
60+
# PY3PATH: ""
61+
# defaults:
62+
# run:
63+
# shell: msys2 {0}
64+
# steps:
65+
# - name: Checkout
66+
# uses: actions/checkout@v4
67+
# with:
68+
# fetch-depth: 0
6569

66-
- name: Build
67-
run: ./.github/scripts/build-msys2.sh
70+
# - name: Install MSYS2
71+
# uses: msys2/setup-msys2@v2
72+
# with:
73+
# msystem: UCRT64
74+
# update: true
75+
# install:
76+
# git autoconf automake make zip
77+
# mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-python
78+
# mingw-w64-ucrt-x86_64-python-pygame
6879

69-
macos:
70-
name: "macOS build"
71-
runs-on: macos-15
72-
env:
73-
PREFIX: "/opt/homebrew"
74-
PY3PATH: "/opt/homebrew/bin"
75-
steps:
76-
- name: Checkout
77-
uses: actions/checkout@v4
80+
# - name: Install ngdevkit dependencies
81+
# run: |
82+
# echo -e "[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf
83+
# pacman -Sy
84+
# pacman -S --disable-download-timeout --noconfirm mingw-w64-ucrt-x86_64-ngdevkit-toolchain
7885

79-
- name: Dependencies
80-
run: |
81-
brew tap dciabrin/ngdevkit
82-
brew install python3 --overwrite
83-
brew install automake ngdevkit-toolchain zip pkg-config sdl2 sdl2_image
84-
$(brew --prefix python)/libexec/bin/pip install pygame --break-system-packages
86+
# - name: Build
87+
# run: ./.github/scripts/build-msys2.sh
8588

86-
- name: Build
87-
run: ./.github/scripts/build.sh
89+
# macos:
90+
# name: "macOS build"
91+
# runs-on: macos-15
92+
# env:
93+
# PREFIX: "/opt/homebrew"
94+
# PY3PATH: "/opt/homebrew/bin"
95+
# steps:
96+
# - name: Checkout
97+
# uses: actions/checkout@v4
8898

89-
- name: Install dependencies for ngdevkit-examples
90-
run: |
91-
brew install ngdevkit-gngeo imagemagick sox glew make
92-
$(brew --prefix python)/libexec/bin/pip install pyyaml --break-system-packages
99+
# - name: Dependencies
100+
# run: |
101+
# brew tap dciabrin/ngdevkit
102+
# brew install python3 --overwrite
103+
# brew install automake ngdevkit-toolchain zip pkg-config sdl2 sdl2_image
104+
# $(brew --prefix python)/libexec/bin/pip install pygame --break-system-packages
105+
106+
# - name: Build
107+
# run: ./.github/scripts/build.sh
108+
109+
# - name: Install dependencies for ngdevkit-examples
110+
# run: |
111+
# brew install ngdevkit-gngeo imagemagick sox glew make
112+
# $(brew --prefix python)/libexec/bin/pip install pyyaml --break-system-packages
93113

94-
- name: Test by compiling ngdevkit-examples
95-
run: ./.github/scripts/test.sh
114+
# - name: Test by compiling ngdevkit-examples
115+
# run: ./.github/scripts/test.sh

0 commit comments

Comments
 (0)