Merge pull request #175 from can-hub-io/chore/release-0.3.0 #232
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
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # Superseded runs on the same ref are cancelled; a new push to a branch stops | |
| # the in-flight CI instead of running it to completion alongside the new one. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-x86_64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build libssl-dev perl | |
| - name: cache build trees | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: x86_64-${{ hashFiles('CMakeLists.txt', 'test/CMakeLists.txt', 'cmake/**') }} | |
| - name: unit tests | |
| run: make test | |
| - name: release build | |
| run: make release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: can-hub-x86_64 | |
| path: build/x86_64/release/can-hub* | |
| retention-days: 7 | |
| cross-armhf: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install dependencies | |
| run: | | |
| sudo dpkg --add-architecture armhf | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf perl | |
| - name: cache build tree | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: armhf-${{ hashFiles('CMakeLists.txt', 'cmake/**') }} | |
| - name: release build | |
| run: make release ARCH=armhf | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: can-hub-armhf | |
| path: build/armhf/release/can-hub* | |
| retention-days: 7 | |
| windows-libcanhub: | |
| runs-on: ubuntu-latest | |
| env: | |
| LLVM_MINGW_VERSION: "20260602" | |
| LLVM_MINGW_SHA256: 9d191203f9768ead60662d3ae53cdf28e0a28b1e6d44b7f329b9202cb2add337 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build perl | |
| - name: install llvm-mingw | |
| run: | | |
| curl -fsSL -o /tmp/llvm-mingw.tar.xz "https://github.com/mstorsjo/llvm-mingw/releases/download/$LLVM_MINGW_VERSION/llvm-mingw-$LLVM_MINGW_VERSION-ucrt-ubuntu-22.04-x86_64.tar.xz" | |
| echo "$LLVM_MINGW_SHA256 /tmp/llvm-mingw.tar.xz" | sha256sum -c | |
| mkdir -p "$HOME/llvm-mingw" | |
| tar -xf /tmp/llvm-mingw.tar.xz --strip-components=1 -C "$HOME/llvm-mingw" | |
| - name: cache build tree | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: mingw-x86_64-${{ hashFiles('CMakeLists.txt', 'cmake/**') }} | |
| - name: windows build | |
| run: PATH="$HOME/llvm-mingw/bin:$PATH" make windows | |
| - name: win_amd64 wheel | |
| run: PATH="$HOME/llvm-mingw/bin:$PATH" ./scripts/build-python-wheel-windows.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: libcanhub-windows-x86_64 | |
| path: | | |
| build/mingw-x86_64/release/libcanhub.dll | |
| build/mingw-x86_64/release/libcanhub.a | |
| build/mingw-x86_64/release/canhub-dump.exe | |
| python/dist/*.whl | |
| retention-days: 7 | |
| web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: web/daemon | |
| - name: daemon tests | |
| working-directory: web/daemon | |
| run: cargo test | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: web/ui/package-lock.json | |
| - name: ui install | |
| working-directory: web/ui | |
| run: npm ci | |
| - name: ui lint | |
| working-directory: web/ui | |
| run: npm run lint | |
| - name: ui build | |
| working-directory: web/ui | |
| run: npm run build | |
| static: | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [armv7, arm64, x86_64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: static build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/static.Dockerfile | |
| build-args: ARCH=${{ matrix.arch }} | |
| outputs: type=local,dest=dist/${{ matrix.arch }} | |
| cache-from: type=gha,scope=static-${{ matrix.arch }} | |
| cache-to: type=gha,scope=static-${{ matrix.arch }},mode=max | |
| - name: verify static linkage | |
| run: | | |
| file dist/${{ matrix.arch }}/can-hub-agent | |
| file dist/${{ matrix.arch }}/can-hub-agent | grep -q "statically linked" | |
| - name: lintian | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y lintian | |
| lintian --fail-on error dist/${{ matrix.arch }}/*.deb | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: can-hub-static-${{ matrix.arch }} | |
| path: dist/${{ matrix.arch }}/can-hub* | |
| retention-days: 7 | |
| deb: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y cmake ninja-build perl lintian | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: web/daemon | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: web/ui/package-lock.json | |
| - name: cache build tree | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: deb-${{ hashFiles('CMakeLists.txt', 'cmake/**') }} | |
| - name: build per-binary debs | |
| run: make deb | |
| - name: lintian | |
| run: lintian --fail-on error build/x86_64/package/*.deb |