refactor: restructure codebase for pybind11 and add CI workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/build.yml | |
| name: Build ectool | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y cmake clang ninja-build git libftdi1-dev libusb-1.0-0-dev pkg-config | |
| - name: Configure CMake | |
| run: | | |
| mkdir _build | |
| cd _build | |
| CC=clang CXX=clang++ cmake -GNinja .. | |
| - name: Build | |
| run: | | |
| cd _build | |
| ninja | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: ectool-linux | |
| path: _build/src/ectool | |
| build-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Configure CMake | |
| run: | | |
| mkdir _build | |
| cd _build | |
| & "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -A x64 -T ClangCL .. | |
| - name: Build | |
| run: | | |
| cd _build | |
| & "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build . --config RelWithDebInfo --parallel | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: ectool-windows | |
| path: | | |
| _build/src/RelWithDebInfo/ectool.exe | |
| _build/src/RelWithDebInfo/ectool.pdb |