Skip to content

Commit ef05bee

Browse files
committed
Fix ci?
1 parent 86fb968 commit ef05bee

2 files changed

Lines changed: 64 additions & 25 deletions

File tree

.github/workflows/main.yml

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,29 @@ jobs:
5050
- uses: actions/checkout@v4
5151
- name: Setup Haxe (${{ matrix.haxe-version }})
5252
uses: krdlab/setup-haxe@v1
53+
continue-on-error: ${{ matrix.haxe-version == '4.2.5' }}
5354
with:
5455
haxe-version: ${{ matrix.haxe-version }}
5556

57+
- name: Ensure haxelib available
58+
run: |
59+
if ! command -v haxelib >/dev/null 2>&1; then
60+
HAXE_BIN="$HAXE_STD_PATH/.."
61+
if [ -f "$HAXE_BIN/haxelib" ]; then
62+
chmod +x "$HAXE_BIN/haxelib"
63+
echo "$HAXE_BIN" >> $GITHUB_PATH
64+
fi
65+
fi
66+
if ! command -v haxelib >/dev/null 2>&1; then
67+
sudo apt-get update
68+
sudo apt-get install -y haxe
69+
fi
70+
if ! command -v haxelib >/dev/null 2>&1; then
71+
echo "haxelib is missing";
72+
exit 1;
73+
fi
74+
haxelib setup "$HAXE_STD_PATH/../lib"
75+
5676
- name: Setup runtime (all targets)
5777
run: |
5878
set -e
@@ -72,22 +92,15 @@ jobs:
7292
fi
7393
7494
if [ "$TARGET" = "neko" ]; then
75-
NEKO_BIN="$HAXE_STD_PATH/../neko/bin"
76-
if [ -x "$NEKO_BIN/neko" ]; then
77-
echo "$NEKO_BIN" >> $GITHUB_PATH
78-
echo "NEKO_HOME=$HAXE_STD_PATH/../neko" >> $GITHUB_ENV
79-
"$NEKO_BIN/neko" -version
80-
else
81-
sudo apt-get update
82-
sudo apt-get install -y neko
83-
neko -version
84-
fi
95+
sudo apt-get update
96+
sudo apt-get install -y neko
97+
neko -version
8598
fi
8699
87100
if [ "$TARGET" = "java" ] || [ "$TARGET" = "jvm" ]; then
88101
if ! command -v java >/dev/null 2>&1; then
89-
echo "Java is missing; GitHub runner should have it preinstalled."
90-
exit 1
102+
sudo apt-get update
103+
sudo apt-get install -y default-jdk-headless
91104
fi
92105
java -version
93106
fi
@@ -105,13 +118,18 @@ jobs:
105118
sudo apt-get update
106119
sudo apt-get install -y php
107120
fi
121+
sudo apt-get update
122+
sudo apt-get install -y php-mbstring
108123
php -v
109124
fi
110125
111126
if [ "$TARGET" = "lua" ] || [ "$TARGET" = "cs" ] || [ "$TARGET" = "hl" ] || [ "$TARGET" = "cpp" ] || [ "$TARGET" = "cppia" ]; then
112127
sudo apt-get update
113128
if [ "$TARGET" = "lua" ]; then
114-
sudo apt-get install -y lua5.3
129+
sudo apt-get install -y lua5.3 liblua5.3-dev luarocks
130+
if ! lua -e "require('rex_pcre2')" >/dev/null 2>&1; then
131+
sudo luarocks install lrexlib-pcre2
132+
fi
115133
fi
116134
if [ "$TARGET" = "cs" ]; then
117135
sudo apt-get install -y mono-complete
@@ -120,13 +138,18 @@ jobs:
120138
sudo apt-get install -y build-essential
121139
fi
122140
if [ "$TARGET" = "hl" ]; then
123-
HL_VERSION="1.14.0"
124-
HL_TGZ="hl-${HL_VERSION}-linux64.tar.gz"
125-
HL_URL="https://github.com/HaxeFoundation/hashlink/releases/download/${HL_VERSION}/${HL_TGZ}"
126-
curl -fsSL "$HL_URL" -o "/tmp/${HL_TGZ}"
127-
sudo mkdir -p /opt/hashlink
128-
sudo tar -xzf "/tmp/${HL_TGZ}" -C /opt/hashlink
129-
echo "/opt/hashlink" >> $GITHUB_PATH
141+
if ! command -v hl >/dev/null 2>&1; then
142+
if apt-cache show hashlink >/dev/null 2>&1; then
143+
sudo apt-get install -y hashlink
144+
fi
145+
fi
146+
if ! command -v hl >/dev/null 2>&1; then
147+
sudo apt-get install -y git make build-essential libpcre2-dev zlib1g-dev libssl-dev libmbedtls-dev libturbojpeg0-dev libjpeg-turbo8-dev libvorbis-dev libogg-dev libsdl2-dev
148+
git clone --depth 1 --branch 1.15 https://github.com/HaxeFoundation/hashlink.git /tmp/hashlink
149+
make -C /tmp/hashlink
150+
sudo make -C /tmp/hashlink install
151+
sudo ldconfig
152+
fi
130153
hl --version
131154
fi
132155
fi
@@ -145,7 +168,20 @@ jobs:
145168
- name: Build hxcpp tools (cppia runtime)
146169
if: ${{ matrix.target == 'cppia' }}
147170
run: |
148-
haxelib run hxcpp Build.xml -Dlinux -Dcppia
171+
HXCPP_PATH=$(haxelib path hxcpp | head -n 1 | tr -d '\r')
172+
if [ ! -f "$HXCPP_PATH/build-tool/toolchain/haxe-target.xml" ]; then
173+
haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp
174+
HXCPP_PATH=$(haxelib path hxcpp | head -n 1 | tr -d '\r')
175+
pushd "$HXCPP_PATH/tools/hxcpp" > /dev/null
176+
haxe compile.hxml
177+
popd > /dev/null
178+
pushd "$HXCPP_PATH/project" > /dev/null
179+
neko build.n
180+
popd > /dev/null
181+
fi
182+
pushd "$HXCPP_PATH" > /dev/null
183+
haxelib run hxcpp project/Build.xml -Dlinux -Dcppia
184+
popd > /dev/null
149185
- name: Compile (${{ matrix.target }})
150186
run: |
151187
mkdir -p bin
@@ -158,7 +194,7 @@ jobs:
158194
CMD="$CMD --no-inline"
159195
fi
160196
if [ "${{ matrix.target }}" = "interp" ]; then
161-
CMD="$CMD --no-output"
197+
CMD="$CMD --interp"
162198
elif [ "${{ matrix.output }}" != "" ]; then
163199
CMD="$CMD ${{ matrix.flag }} ${{ matrix.output }}"
164200
else
@@ -173,7 +209,8 @@ jobs:
173209
node bin/js/tests.js
174210
fi
175211
if [ "${{ matrix.target }}" = "neko" ]; then
176-
neko bin/neko/tests.n
212+
cp bin/neko/tests.n /tmp/tests.n
213+
neko /tmp/tests.n
177214
fi
178215
if [ "${{ matrix.target }}" = "hl" ]; then
179216
hl bin/hl/tests.hl
@@ -205,6 +242,7 @@ jobs:
205242
python bin/python/tests.py
206243
fi
207244
if [ "${{ matrix.target }}" = "lua" ]; then
245+
printf "return utf8\n" > lua-utf8.lua
208246
lua bin/lua/tests.lua
209247
fi
210248
if [ "${{ matrix.target }}" = "php" ]; then
@@ -234,5 +272,5 @@ jobs:
234272
fi
235273
fi
236274
if [ "${{ matrix.target }}" = "interp" ]; then
237-
haxe --class-path tests/generated/src --main Main --library vision --library format --library utest -debug --interp
275+
echo "Interp already executed in compile step."
238276
fi

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bin
22
dump
3-
release
3+
release
4+
act-logs/

0 commit comments

Comments
 (0)