Skip to content

Commit d2426f8

Browse files
committed
gh actions: add compilation with mingw (cross-compilation with CMake).
1 parent 8ca38de commit d2426f8

File tree

1 file changed

+119
-0
lines changed

1 file changed

+119
-0
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: cmake-cross-mingw
2+
3+
on:
4+
push:
5+
branches: [
6+
"master",
7+
"devel",
8+
"citest",
9+
"citest-cmake",
10+
"citest-cmake-cross-mingw" ]
11+
tags:
12+
- '**'
13+
pull_request:
14+
branches: [ "master", "devel" ]
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
# build_type: [ x86_64, i686 ]
22+
build_type: [ x86_64 ]
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: install prereq.
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y check gcc-mingw-w64-x86-64-win32
29+
- name: cmake_shared_configure
30+
run: |
31+
CC=${{ matrix.build_type }}-w64-mingw32-gcc \
32+
util/cmake_shared_configure \
33+
-DADFLIB_ENABLE_TESTS=OFF
34+
- name: cmake_shared_build
35+
run: util/cmake_shared_build
36+
# - name: cmake_shared_test
37+
# run: util/cmake_shared_test
38+
# - name: cmake_shared_install
39+
# run: sudo bash util/cmake_shared_install
40+
# - name: check installation
41+
# run: find /usr/local -iname '*adf*'
42+
# - name: update ldconfig
43+
# run: sudo ldconfig
44+
# - name: test command-line utils
45+
# run: ./tests/examples/test_all_examples.sh /usr/local/bin
46+
- name: check build output files
47+
run: find build/
48+
- name: prepare artifact
49+
run: |
50+
mkdir -vp artifacts/bin
51+
cp -v build/shared/src/libadf* artifacts/bin/
52+
cp -v build/shared/examples/*.exe artifacts/bin/
53+
mkdir -v artifacts/include
54+
cp -vR src/*.h artifacts/include
55+
cp -vR BUGS.md \
56+
NOTES.md \
57+
README.md \
58+
COPYING* \
59+
AUTHORS \
60+
ChangeLog \
61+
TODO \
62+
doc \
63+
artifacts/
64+
cd artifacts ; \
65+
tar cvzf ../adflib-mingw-${{ matrix.build_type }}.tgz *
66+
cd ..
67+
- uses: actions/upload-artifact@v4
68+
with:
69+
# name: adflib-${{ env.ADFLIB_TAG }}-mingw
70+
name: adflib-mingw-${{ matrix.build_type }}
71+
path: |
72+
adflib-mingw-${{ matrix.build_type }}.tgz
73+
74+
test:
75+
needs: build
76+
runs-on: windows-latest
77+
strategy:
78+
matrix:
79+
# build_type: [ x86_64, i686 ]
80+
build_type: [ x86_64 ]
81+
steps:
82+
- uses: actions/checkout@v4
83+
- uses: actions/download-artifact@v4
84+
with:
85+
# name: adflib-${{ env.ADFLIB_TAG }}-mingw
86+
name: adflib-mingw-${{ matrix.build_type }}
87+
path: .
88+
- name: extract file from the artifact
89+
run: tar xzvf adflib-mingw-${{ matrix.build_type }}.tgz
90+
- name: list files extracted from the artifact
91+
shell: bash
92+
run: find bin/
93+
- name: show properties of binaries (installed)
94+
shell: bash
95+
run: ldd bin/unadf
96+
- name: configure tests
97+
shell: bash
98+
run: |
99+
cat tests/config.sh.in_cmake | \
100+
sed -e 's@\${PROJECT_BINARY_DIR}@./bin/@' \
101+
-e 's@\${PROJECT_SOURCE_DIR}@./@' \
102+
> tests/config.sh
103+
cat tests/config.sh
104+
- name: test command-line utils
105+
shell: bash
106+
run: |
107+
tests/examples/test_examples_basic.sh bin/
108+
tests/examples/test_all_examples.sh bin/
109+
- name: test installed command-line utils (2)
110+
shell: bash
111+
run: |
112+
./tests/examples2/run_all_tests.sh bin
113+
- name: store logs from failed tests
114+
if: failure()
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: cmake_cross_mingw_${{ matrix.build_type }}_logs_failed_tests
118+
path: |
119+
cmake/shared/Testing/

0 commit comments

Comments
 (0)