Skip to content

Commit cd193a0

Browse files
committed
Check also using mingw32
1 parent bb5a00c commit cd193a0

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

.github/workflows/compilation.yml

+29-10
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,49 @@ name: CI
33
on:
44
push:
55
pull_request:
6+
workflow_dispatch: {}
67

78
jobs:
89
build:
9-
runs-on: ${{ matrix.os }}
10+
runs-on: ${{ matrix.os[0] }}
1011
strategy:
1112
matrix:
12-
os: [macos-latest, ubuntu-latest]
13-
14-
steps:
13+
os: [[macos-latest, bash], [ubuntu-latest, bash], [windows-latest, msys2]]
14+
fail-fast: false
15+
defaults:
16+
run:
17+
shell: ${{ matrix.os[1] }} {0}
18+
19+
steps:
1520
- uses: actions/checkout@v4
1621

22+
- name: Install MSYS2 packages
23+
if: matrix.os[0] == 'windows-latest'
24+
uses: msys2/setup-msys2@v2
25+
with:
26+
msystem: MINGW32
27+
install: |
28+
base-devel mingw-w64-i686-gcc
29+
update: true
30+
1731
- name: Compile native versions
1832
run: |
19-
make --debug
33+
make -j $(getconf _NPROCESSORS_ONLN) clean
34+
make -j $(getconf _NPROCESSORS_ONLN) all
2035
2136
- name: Get short SHA
2237
id: slug
2338
run: |
2439
echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
2540
2641
- name: Create tar archive (keep executable bit)
27-
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}.tar.gz bin
42+
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os[0]}}.tar.gz bin
2843

29-
- uses: actions/upload-artifact@v4
44+
- name: Upload artefacts
45+
if: matrix.os[0] != 'windows-latest'
46+
uses: actions/upload-artifact@v4
3047
with:
31-
name: ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}
48+
name: ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os[0]}}
3249
path: |
3350
*tar.gz
3451
@@ -41,11 +58,13 @@ jobs:
4158

4259
- name: Compile windows version with cross-compilator
4360
run: |
44-
make -f Makefile.mingw32 --trace
61+
make -j $(getconf _NPROCESSORS_ONLN) --trace clean
62+
make -j $(getconf _NPROCESSORS_ONLN) --trace all
4563
4664
- name: Get short SHA
4765
id: slug
48-
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
66+
run: |
67+
echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
4968
5069
- name: Create tar archive
5170
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest.tar.gz bin

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
CFLAGS += -O2
1313
endif
1414

15-
ifneq "MINGW" "$(findstring MINGW,$(MSYSTEM))"
16-
LIBS = -lpthread
17-
else
15+
ifeq ($(OS),Windows_NT)
1816
LIBS = -lwsock32
17+
else
18+
LIBS = -lpthread
1919
endif
2020

2121
ifeq "x$(PREFIX)" "x"
2222
PREFIX = $(PS2DEV)
2323
endif
2424

25-
ifeq "MINGW" "$(findstring MINGW,$(MSYSTEM))"
25+
ifeq ($(OS),Windows_NT)
2626
all:
2727
$(MAKE) -f Makefile.mingw32 all
2828

0 commit comments

Comments
 (0)