diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 6445b34..e2a3720 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -40,4 +40,23 @@ jobs: - name: Only build run: | - docker buildx build --platform linux/amd64 --output "type=image,push=false" -f tests/Dockerfile-${{ matrix.distro }} . \ No newline at end of file + docker buildx build --platform linux/amd64 --output "type=image,push=false" -f tests/Dockerfile-${{ matrix.distro }} . + + test-macos: + # macOS has no equivalent to the Dockerfile-based distro tests above + # (no official macOS container images), so this runs directly on a + # hosted macOS runner instead. + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Full install + run: make + + # Verify the install actually landed, not just that `make` exited 0. + - name: Verify install + run: | + test -L ~/.config/nvim/init.lua + test -L ~/.config/fish/conf.d/aliases.fish + fish -c 'functions -q gitissue' + fish -c 'functions -q fisher' \ No newline at end of file diff --git a/README.md b/README.md index 54b3764..c25c938 100644 --- a/README.md +++ b/README.md @@ -227,18 +227,21 @@ When you submit a pull request, the following automated checks run: - Arch Linux - Fedora - Ubuntu + - macOS -- **Docker-based Testing**: Each distribution test runs in a containerized environment using Docker Buildx with QEMU for cross-platform compatibility +- **Docker-based Testing**: Each Linux distribution test runs in a containerized environment using Docker Buildx with QEMU for cross-platform compatibility -- **Build Verification**: The GitHub Action (`pr-test.yml`) verifies that the dotfiles can be successfully built on each supported platform +- **Native Testing**: macOS has no equivalent official container image, so it runs the full install directly on a hosted `macos-latest` runner instead + +- **Build Verification**: The GitHub Action (`pr-test.yml`) verifies that the dotfiles can be successfully built on each supported platform, and that the install actually landed (symlinks in place, fish functions loaded) — not just that the install command exited 0 ### Workflow Details The PR testing workflow: 1. Triggers on pull requests to `master` or `main` branches -2. Uses a matrix strategy to test against multiple Linux distributions -3. Sets up QEMU and Docker Buildx for multi-platform testing -4. Builds the dotfiles installation in each distribution's container +2. Uses a matrix strategy to test against multiple Linux distributions, plus a separate macOS job +3. Sets up QEMU and Docker Buildx for multi-platform Linux testing +4. Builds the dotfiles installation in each distribution's container, and runs the full install natively on macOS This ensures that changes don't break compatibility with any supported operating system before they're merged. diff --git a/install-scripts/01-install-packages.sh b/install-scripts/01-install-packages.sh index 5f1e29a..25c9811 100755 --- a/install-scripts/01-install-packages.sh +++ b/install-scripts/01-install-packages.sh @@ -37,6 +37,7 @@ if [ -f /etc/arch-release ]; then # install yay if ! command -v yay >/dev/null 2>&1 && [ "$EUID" -ne 0 ]; then sudo pacman -S --noconfirm base-devel + rm -rf yay git clone https://aur.archlinux.org/yay.git cd yay makepkg -si --noconfirm diff --git a/install-scripts/07-last-touches.sh b/install-scripts/07-last-touches.sh index 9846c3c..7d5641c 100755 --- a/install-scripts/07-last-touches.sh +++ b/install-scripts/07-last-touches.sh @@ -9,8 +9,11 @@ if ! grep -q "$fish_path" /etc/shells; then fi # change shell to fish +# (via sudo + explicit user: plain `chsh` re-authenticates as the invoking +# user even when they already have sudo rights, which hangs non-interactive +# installs; root can change any user's shell without a further password) if ! [ "$(basename "$SHELL")" == "fish" ]; then - chsh -s "$fish_path" + sudo chsh -s "$fish_path" "$(id -un)" fi # create local bin directory