Skip to content

Commit 0bbacbe

Browse files
committed
gh action / cmake / windows: build and test debug and release versions.
1 parent 8ca38de commit 0bbacbe

File tree

2 files changed

+151
-5
lines changed

2 files changed

+151
-5
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: cmake-windows-release
2+
3+
on:
4+
push:
5+
branches: [ "master", "devel",
6+
"citest",
7+
"citest-cmake",
8+
"citest-cmake-windows" ]
9+
tags:
10+
- '**'
11+
pull_request:
12+
branches: [ "master", "devel" ]
13+
14+
jobs:
15+
windows_build:
16+
runs-on: windows-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: install prereq.
20+
run: |
21+
choco install ninja cmake gzip
22+
ninja --version
23+
cmake --version
24+
gzip --version
25+
- name: cmake_shared_configure
26+
shell: bash
27+
# run: util/cmake_shared_configure
28+
run: util/cmake_shared_configure --config x64-Release-Shared
29+
- name: cmake_shared_build
30+
shell: bash
31+
run: util/cmake_shared_build
32+
- name: copy binaries to orig. dirs
33+
shell: bash
34+
run: |
35+
cp -v build/shared/tests/regr/Release/*.exe build/shared/tests/regr/
36+
cp -v build/shared/tests/unit/Release/*.exe build/shared/tests/unit/
37+
cp -v build/shared/examples/Release/*.exe build/shared/examples/
38+
- name: copy dll to dirs with test exe
39+
shell: bash
40+
run: |
41+
cp -v build/shared/src/Release/*.dll build/shared/tests/regr/
42+
cp -v build/shared/src/Release/*.dll build/shared/tests/unit/
43+
cp -v build/shared/src/Release/*.dll build/shared/examples/
44+
- name: cmake_shared_test
45+
shell: bash
46+
run: util/cmake_shared_test
47+
# - name: cmake_shared_install
48+
# shell: bash
49+
# run: util/cmake_shared_install
50+
- name: check build files
51+
shell: bash
52+
run: |
53+
pwd
54+
find
55+
- name: prepare artifacts
56+
shell: bash
57+
run: |
58+
mkdir -p artifacts/bin
59+
cp -v build/shared/src/Release/*.dll \
60+
build/shared/examples/Release/*.exe \
61+
artifacts/bin
62+
mkdir artifacts/include
63+
cp -vR src/*.h artifacts/include
64+
cp -vR README.md \
65+
COPYING* \
66+
AUTHORS \
67+
ChangeLog \
68+
doc \
69+
artifacts/
70+
- name: set env
71+
shell: bash
72+
run: echo "ADFLIB_TAG=${GITHUB_REF#refs/*/}" | tr / _ >> $GITHUB_ENV
73+
- name: Test
74+
shell: bash
75+
run: |
76+
echo $ADFLIB_TAG
77+
echo ${{ env.ADFLIB_TAG }}
78+
- uses: actions/upload-artifact@v4
79+
with:
80+
# name: adflib-${{ env.ADFLIB_TAG }}-windows
81+
name: adflib-windows
82+
path: |
83+
artifacts/
84+
- name: archive tests/examples
85+
shell: bash
86+
run: |
87+
mkdir -v artifact-tests
88+
tar cvzf artifact-tests/tests_examples.tgz \
89+
tests/config* \
90+
tests/examples/ \
91+
tests/examples2/ \
92+
tests/data
93+
- uses: actions/upload-artifact@v4
94+
with:
95+
name: adflib-windows-tests-examples
96+
path: |
97+
artifact-tests
98+
99+
windows_test:
100+
runs-on: windows-latest
101+
needs: windows_build
102+
steps:
103+
- uses: actions/download-artifact@v4
104+
with:
105+
# name: adflib-${{ env.ADFLIB_TAG }}-windows
106+
name: adflib-windows
107+
path: .
108+
- name: install prereq.
109+
run: |
110+
choco install gzip
111+
gzip --version
112+
- name: list files extracted from the artifact
113+
shell: bash
114+
run: find .
115+
- uses: actions/download-artifact@v4
116+
with:
117+
name: adflib-windows-tests-examples
118+
path: .
119+
- name: extract tests/examples
120+
shell: bash
121+
run: tar xvzf tests_examples.tgz
122+
- name: test command-line utils
123+
shell: bash
124+
# these test does not work - output on windows is different (EOL is CR+LF)
125+
# run: ./examples/tests/test_all_examples.sh bin
126+
# for just check if they execute at all instead
127+
run: |
128+
tests/examples/test_examples_basic.sh bin/
129+
tests/examples/test_all_examples.sh bin
130+
- name: test installed command-line utils (2)
131+
shell: bash
132+
run: |
133+
cat tests/config.sh.in_cmake | \
134+
sed -e 's@\${PROJECT_BINARY_DIR}@'"."'@' \
135+
-e 's@\${PROJECT_SOURCE_DIR}@'"."'@' \
136+
> tests/config.sh
137+
cat tests/config.sh
138+
./tests/examples2/run_all_tests.sh bin
139+
- name: store logs from failed tests
140+
if: failure()
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: cmake_windows_logs_failed_tests
144+
path: |
145+
cmake/shared/Testing/

.github/workflows/cmake-windows.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- name: cmake_shared_configure
2626
shell: bash
2727
run: util/cmake_shared_configure
28+
# run: util/cmake_shared_configure --config x64-Release-Shared
2829
- name: cmake_shared_build
2930
shell: bash
3031
run: util/cmake_shared_build
@@ -77,7 +78,7 @@ jobs:
7778
- uses: actions/upload-artifact@v4
7879
with:
7980
# name: adflib-${{ env.ADFLIB_TAG }}-windows
80-
name: adflib-windows
81+
name: adflib-windows-debug
8182
path: |
8283
artifacts/
8384
- name: archive tests/examples
@@ -91,7 +92,7 @@ jobs:
9192
tests/data
9293
- uses: actions/upload-artifact@v4
9394
with:
94-
name: adflib-windows-tests-examples
95+
name: adflib-windows-tests-examples-debug
9596
path: |
9697
artifact-tests
9798
@@ -102,7 +103,7 @@ jobs:
102103
- uses: actions/download-artifact@v4
103104
with:
104105
# name: adflib-${{ env.ADFLIB_TAG }}-windows
105-
name: adflib-windows
106+
name: adflib-windows-debug
106107
path: .
107108
- name: install prereq.
108109
run: |
@@ -113,7 +114,7 @@ jobs:
113114
run: find .
114115
- uses: actions/download-artifact@v4
115116
with:
116-
name: adflib-windows-tests-examples
117+
name: adflib-windows-tests-examples-debug
117118
path: .
118119
- name: extract tests/examples
119120
shell: bash
@@ -139,6 +140,6 @@ jobs:
139140
if: failure()
140141
uses: actions/upload-artifact@v4
141142
with:
142-
name: cmake_windows_logs_failed_tests
143+
name: cmake_windows_logs_failed_tests-debug
143144
path: |
144145
cmake/shared/Testing/

0 commit comments

Comments
 (0)