name: CI on: push: branches: - main pull_request: branches: - main jobs: build-and-test: name: Build and Test strategy: matrix: os: [ubuntu-latest, macOS-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 with: submodules: recursive - id: hashes name: Compute cache hashes run: | echo "nbs=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT echo "libchat=$(git rev-parse HEAD:vendor/libchat)" >> $GITHUB_OUTPUT # Cache the Nim compiler built by nimbus-build-system (NBS). # Building Nim from source is the slowest part of `make update`. # Keyed on the NBS submodule commit — auto-invalidates when NBS is bumped. - name: Cache/restore NBS uses: actions/cache@v4 with: path: vendor/nimbus-build-system/vendor/Nim key: ${{ runner.os }}-nbs-${{ steps.hashes.outputs.nbs }} - name: Cache/restore Cargo registry uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git key: ${{ runner.os }}-cargo-deps-${{ hashFiles('vendor/libchat/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-deps- - name: Cache/restore libchat uses: actions/cache@v4 with: path: vendor/libchat/target key: ${{ runner.os }}-libchat-${{ steps.hashes.outputs.libchat }} - name: Update dependencies run: make update - name: Build run: make all - name: Test run: make tests nix-build: name: Nix Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: submodules: recursive - uses: cachix/install-nix-action@v27 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | experimental-features = nix-command flakes - name: Build run: nix build ".?submodules=1#" --print-build-logs - name: Verify outputs run: | test -f result/lib/liblogoschat.so test -f result/include/liblogoschat.h