1- # Axel '0vercl0k' Souchet - July 26 2020
21name : Builds
32
43on : [push, pull_request]
54
65jobs :
7- Ubuntu2004 :
6+ testdatas :
7+ env :
8+ TESTDATA_URL : https://github.com/0vercl0k/kdmp-parser/releases/download/v0.1/testdatas.7z
9+
10+ name : Fetch Test Data
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Cache Artifacts
14+ id : cache-testdatas
15+ uses : actions/cache@v3
16+ with :
17+ key : kdmp-parser-testdatas-cache
18+ path : .
19+ - if : steps.cache-testdatas.outputs.cache-hit != 'true'
20+ run : |
21+ sudo apt-get -y update; sudo apt-get install -y p7zip-full;
22+ curl ${{ env.TESTDATA_URL }} -O -L
23+ 7z x testdatas.7z; rm testdatas.7z
24+ - name : Upload artifacts
25+ uses : actions/upload-artifact@v3
26+ with :
27+ if-no-files-found : error
28+ name : kdmp-parser-testdatas-cache
29+ path : .
30+
31+ parser :
32+ needs : testdatas
833 strategy :
934 fail-fast : false
1035 matrix :
11- # Available versions: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
12- # We don't test below 3.6 because f'strings were implemented in 3.6 and we use them in build scripts, etc.
13- pyver : ['3.6', '3.7', '3.8', '3.9', '3.x']
14- compiler : ['clang', 'gcc']
36+ variant :
37+ - {os: windows-latest, generator: msvc, arch: x64, config: RelWithDebInfo}
38+ - {os: windows-latest, generator: ninja, arch: x64, config: RelWithDebInfo}
39+ - {os: windows-latest, generator: msvc, arch: win32, config: RelWithDebInfo}
40+ # - {os: windows-latest, generator: msvc, arch: arm64, config: RelWithDebInfo}
41+ - {os: ubuntu-latest, generator: gcc, arch: x64, config: RelWithDebInfo}
42+ - {os: ubuntu-latest, generator: clang, arch: x64, config: RelWithDebInfo}
43+ - {os: macos-latest, generator: clang, arch: x64, config: Release}
44+ runs-on : ${{ matrix.variant.os }}
45+ name : parser / ${{ matrix.variant.os }} / ${{ matrix.variant.generator }} / ${{ matrix.variant.arch }}
46+ env :
47+ CMAKE_FLAGS : " -DBUILD_PARSER:BOOL=ON -DBUILD_TESTS:BOOL=ON -DBUILD_PYTHON_BINDING:BOOL=OFF"
48+ CMAKE_ARCH : " "
1549
16- name : Ubuntu 20.04 - Py${{ matrix.pyver }} / ${{ matrix.compiler }}
17- runs-on : ubuntu-20.04
1850 steps :
1951 - name : Checkout
20- uses : actions/checkout@v2
52+ uses : actions/checkout@v4
2153
22- - name : Setup Python3
23- uses : actions/setup-python@v2
54+ - name : Retrieve testdatas
55+ uses : actions/download-artifact@v3
2456 with :
25- python-version : ${{ matrix.pyver }}
26- architecture : ' x64 '
57+ name : kdmp-parser-testdatas-cache
58+ path : .
2759
28- - name : Install dependencies
60+ - name : Environment Setup (Windows)
61+ if : matrix.variant.os == 'windows-latest'
62+ run : |
63+ Import-Module .\.github\Invoke-VisualStudio.ps1
64+ Invoke-VisualStudio2022${{ matrix.variant.arch }}
65+ echo "CMAKE_ARCH='-A ${{ matrix.variant.arch }}'" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
66+
67+ - name : Environment Setup (Linux)
68+ if : matrix.variant.os == 'ubuntu-latest'
69+ run : |
70+ sudo apt update
71+
72+ - name : Build (Linux/GCC)
73+ if : matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'gcc'
74+ run : |
75+ sudo apt install -y g++
76+ echo CC=gcc >> $GITHUB_ENV
77+ echo CXX=g++ >> $GITHUB_ENV
78+
79+ - name : Environment Setup (Linux/CLang)
80+ if : matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'clang'
2981 run : |
30- sudo apt-get -y update
31- sudo apt install -y g++-10-multilib g++-10 ninja-build
3282 sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
83+ echo CC=clang >> $GITHUB_ENV
84+ echo CXX=clang++ >> $GITHUB_ENV
3385
34- - name : Build with gcc
35- if : matrix.compiler == 'gcc'
36- run : python3 builder.py --run-tests
37- env :
38- CC : gcc-10
39- CXX : g++-10
40-
41- - name : Build with clang
42- if : matrix.compiler == 'clang'
43- run : python3 builder.py --run-tests
44- env :
45- CC : clang-11
46- CXX : clang++-11
47-
48- - name : Upload artifacts for rel/x64
49- uses : actions/upload-artifact@v2
50- with :
51- name : linx64-RelWithDebInfo-py${{ matrix.pyver }}
52- path : bin/linx64-RelWithDebInfo
86+ - name : Build
87+ run : |
88+ mkdir build
89+ mkdir artifact
90+ cmake -S . -B ./build ${{ env.CMAKE_ARCH }} ${{ env.CMAKE_FLAGS }}
91+ cmake --build ./build --verbose --config ${{ matrix.variant.config }}
92+ cmake --install ./build --config ${{ matrix.variant.config }} --prefix ./artifact
93+
94+ - name : Tests
95+ run : |
96+ mv *.dmp ./build/src/tests/
97+ ctest --progress --build-config ${{ matrix.variant.config }} -T test --test-dir ./build/src/tests/
5398
54- - name : Upload artifacts for dbg/x64
55- uses : actions/upload-artifact@v2
99+ - name : Upload artifacts
100+ uses : actions/upload-artifact@v3
56101 with :
57- name : linx64-Debug-py ${{ matrix.pyver }}
58- path : bin/linx64-Debug
102+ name : parser-${{ matrix.variant.os }}.${{ matrix.variant.generator }}- ${{ matrix.variant.arch }}.${{ matrix.variant.config }}-${{ github.sha }}
103+ path : artifact/
59104
60- Windows :
105+ bindings :
106+ needs : testdatas
61107 strategy :
62108 fail-fast : false
63109 matrix :
64- pyver : ['3.6', '3.7', '3.8', '3.9', '3.x']
65-
66- name : Windows latest - Py${{ matrix.pyver }}
67- runs-on : windows-latest
110+ # nanobind does not support Python < 3.8.
111+ python-version : ['3.8', '3.9', '3.10', '3.11', '3.12']
112+ variant :
113+ - {os: windows-latest, generator: msvc, arch: x64, config: RelWithDebInfo, py-arch: x64}
114+ - {os: windows-latest, generator: msvc, arch: win32, config: RelWithDebInfo, py-arch: x86}
115+ # - {os: windows-latest, generator: msvc, arch: arm64, config: RelWithDebInfo, py-arch: x64} # Unsupported (see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json)
116+ - {os: ubuntu-latest, generator: gcc, arch: x64, config: RelWithDebInfo, py-arch: x64}
117+ - {os: ubuntu-latest, generator: clang, arch: x64, config: RelWithDebInfo, py-arch: x64}
118+ - {os: macos-latest, generator: clang, arch: x64, config: Release, py-arch: x64}
119+ runs-on : ${{ matrix.variant.os }}
120+ name : bindings / ${{ matrix.variant.os }} / ${{ matrix.variant.generator }} / ${{ matrix.python-version }} / ${{ matrix.variant.arch }}
121+ env :
122+ CMAKE_FLAGS : " -DBUILD_PARSER:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_PYTHON_BINDING:BOOL=ON"
68123 steps :
69124 - name : Checkout
70- uses : actions/checkout@v2
125+ uses : actions/checkout@v4
71126
72- - name : Setup Python3
73- uses : actions/setup-python@v2
127+ - name : Retrieve testdatas
128+ uses : actions/download-artifact@v3
74129 with :
75- python-version : ${{ matrix.pyver }}
76- architecture : ' x64 '
130+ name : kdmp-parser-testdatas-cache
131+ path : .
77132
78- - name : Setup vs prompt
79- uses : ilammy/msvc-dev-cmd@v1
133+ - name : Setup Python
134+ uses : actions/setup-python@v4
135+ with :
136+ python-version : ${{ matrix.python-version }}
137+ architecture : ${{ matrix.variant.py-arch }}
80138
81- - name : Build
82- run : python builder.py --run-tests
139+ - name : Environment Setup (Windows)
140+ if : matrix.variant.os == 'windows-latest'
141+ run : |
142+ Import-Module .\.github\Invoke-VisualStudio.ps1
143+ Invoke-VisualStudio2022${{ matrix.variant.arch }}
83144
84- - name : Upload artifacts for rel/x64
85- uses : actions/upload-artifact@v2
86- with :
87- name : winx64-RelWithDebInfo-py${{ matrix.pyver }}
88- path : bin/winx64-RelWithDebInfo
145+ - name : Environment Setup (Linux)
146+ if : matrix.variant.os == 'ubuntu-latest'
147+ run : |
148+ sudo apt-get -y update
149+
150+ - name : Environment Setup (OSX)
151+ if : matrix.variant.os == 'macos-latest'
152+ run : |
153+ echo
154+
155+ - name : Environment Setup (Linux/GCC)
156+ if : matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'gcc'
157+ run : |
158+ sudo apt install -y g++
159+ echo CC=gcc >> $GITHUB_ENV
160+ echo CXX=g++ >> $GITHUB_ENV
161+
162+ - name : Environment Setup (Linux/CLang)
163+ if : matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'clang'
164+ run : |
165+ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
166+ echo CC=clang >> $GITHUB_ENV
167+ echo CXX=clang++ >> $GITHUB_ENV
168+
169+ - name : Build wheel
170+ run : |
171+ mkdir wheel
172+ pip wheel src/python -w ./wheel
173+
174+ - name : Python Binding Tests
175+ run : |
176+ pip install --upgrade pip setuptools wheel
177+ pip install -U -r src/python/tests/requirements.txt
178+ pip install -U --user src/python
179+ pytest -vvv src/python/tests
89180
90- - name : Upload artifacts for dbg/x64
91- uses : actions/upload-artifact@v2
181+ - name : Upload wheel
182+ uses : actions/upload-artifact@v3
92183 with :
93- name : winx64-Debug
94- path : bin/winx64-Debug
184+ name : wheels
185+ path : wheel/*.whl
0 commit comments