mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-02-27 09:23:08 +00:00
71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macOS-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
# 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.
|
|
- id: nbs
|
|
run: echo "hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: vendor/nimbus-build-system/vendor/Nim
|
|
key: ${{ runner.os }}-nbs-${{ steps.nbs.outputs.hash }}
|
|
- run: make update
|
|
- run: make all
|
|
|
|
test:
|
|
name: Test
|
|
needs: build
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macOS-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
- id: nbs
|
|
run: echo "hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: vendor/nimbus-build-system/vendor/Nim
|
|
key: ${{ runner.os }}-nbs-${{ steps.nbs.outputs.hash }}
|
|
- run: make update
|
|
- run: make tests
|
|
|
|
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
|
|
- run: nix build ".?submodules=1#" --print-build-logs
|
|
- name: Verify outputs
|
|
run: |
|
|
test -f result/lib/liblogoschat.so
|
|
test -f result/include/liblogoschat.h
|
|
|