feat: Nix + Nimble #75
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 / nix | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| checks: write | |
| on: | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| # Fast check — catches eval errors without building | |
| check: | |
| name: 'flake check' | |
| runs-on: [self-hosted, Linux, X64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: 'Nix flake check' | |
| run: nix flake check '.?submodules=1' --accept-flake-config | |
| # Run tests on both platforms | |
| test: | |
| name: 'test / ${{ matrix.system }}' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - system: x86_64-linux | |
| runs_on: [self-hosted, Linux, X64] | |
| - system: aarch64-darwin | |
| runs_on: [self-hosted, macOS, ARM64] | |
| runs-on: ${{ matrix.runs_on }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: 'Run tests' | |
| run: | | |
| nix develop '.?submodules=1' --accept-flake-config --command \ | |
| nim test sds.nims | |
| # Build desktop library | |
| build-desktop: | |
| name: '${{ matrix.system }} / libsds' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - system: aarch64-darwin | |
| runs_on: [self-hosted, macOS, ARM64] | |
| - system: x86_64-linux | |
| runs_on: [self-hosted, Linux, X64] | |
| runs-on: ${{ matrix.runs_on }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: 'Build libsds' | |
| run: | | |
| nix build -L '.?submodules=1#libsds' \ | |
| --print-out-paths --accept-flake-config | |
| - name: 'Verify output' | |
| run: ls -la result/lib/ | |
| # Build Android targets only on Linux — avoids macOS cross-compile issues | |
| build-android: | |
| name: 'x86_64-linux / ${{ matrix.nixpkg }}' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| nixpkg: | |
| - libsds-android-arm64 | |
| - libsds-android-amd64 | |
| - libsds-android-x86 | |
| - libsds-android-arm | |
| runs-on: [self-hosted, Linux, X64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: 'Build ${{ matrix.nixpkg }}' | |
| run: | | |
| nix build -L '.?submodules=1#${{ matrix.nixpkg }}' \ | |
| --print-out-paths --accept-flake-config | |
| - name: 'Verify output' | |
| run: ls -laR result/ |