From 611f9322f32d43c3d7c8d47b5db1dc673f41b567 Mon Sep 17 00:00:00 2001 From: Song Jeyeong <46372718+hooreique@users.noreply.github.com> Date: Sun, 20 Sep 2026 08:30:06 +0900 Subject: [PATCH] Add pinned development shell and cross-platform PR CI --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++++++++++++++ README.md | 12 +++++++++--- flake.nix | 10 ++++++++++ cli-test.py => test.py | 2 +- 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yaml rename cli-test.py => test.py (99%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f05d265 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: CI + +on: + pull_request: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + test: + name: build and test (${{ matrix.system }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + include: + - system: x86_64-linux + os: ubuntu-24.04 + - system: aarch64-linux + os: ubuntu-24.04-arm + - system: aarch64-darwin + os: macos-26 + steps: + - uses: actions/checkout@v6.0.2 + - uses: cachix/install-nix-action@v31.10.1 + - name: Build + run: nix build --no-write-lock-file --print-build-logs + - name: Test built package + run: nix develop --no-write-lock-file -c python3 test.py ./result/bin/fall diff --git a/README.md b/README.md index 498713f..60a59d9 100644 --- a/README.md +++ b/README.md @@ -282,15 +282,21 @@ ignored: remove old suffix text or replace it with a registered remote and optio ## Tests +The development shell provides Nushell, Python, and Git pinned by `flake.lock`. + ```sh -nu codec-test.nu -nix shell --inputs-from . nixpkgs#python3 -c python3 cli-test.py +nix develop -c nu codec-test.nu +nix develop -c python3 test.py nix build -nix shell --inputs-from . nixpkgs#python3 -c python3 cli-test.py ./result/bin/fall +nix develop -c python3 test.py ./result/bin/fall ``` The CLI suite uses temporary configurations and repositories, including a worktree, and checks exit codes, diagnostics, boundaries, and state preservation. +Without an argument, `test.py` runs `fall.nu` with Nushell from PATH; with an +executable path, it tests that executable instead. Pull request CI builds the +package and tests `result/bin/fall` once on each supported system +(`x86_64-linux`, `aarch64-linux`, and `aarch64-darwin`). ## After Uninstall diff --git a/flake.nix b/flake.nix index bb6868d..1b86114 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,16 @@ ); in { + devShells = forAllSys (pkgs: { + default = pkgs.mkShell { + packages = [ + pkgs.nushell + pkgs.python3 + pkgs.gitMinimal + ]; + }; + }); + packages = forAllSys (pkgs: { default = pkgs.stdenvNoCC.mkDerivation { pname = "fall"; diff --git a/cli-test.py b/test.py similarity index 99% rename from cli-test.py rename to test.py index 10cbfb6..0cf679a 100644 --- a/cli-test.py +++ b/test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Isolated integration spec: python3 cli-test.py [installed-fall].""" +"""Isolated integration spec: python3 test.py [installed-fall].""" import os import json from pathlib import Path