mirror of
https://github.com/NixOS/nix.git
synced 2025-10-14 19:17:47 +08:00
ci: Simplify installer tests
This commit is contained in:

committed by
Jörg Thalheim

parent
9671275198
commit
c6d0d33e4d
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -81,13 +81,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: installer-${{matrix.os}}
|
name: installer-${{matrix.os}}
|
||||||
path: out
|
path: out
|
||||||
- name: Serving installer
|
- name: Looking up the installer tarball URL
|
||||||
id: serving_installer
|
id: installer-tarball-url
|
||||||
run: ./scripts/serve-installer-for-github-actions
|
run: echo "installer-url=file://$GITHUB_WORKSPACE/out" >> "$GITHUB_OUTPUT"
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
install_url: 'http://localhost:8126/install'
|
install_url: ${{ format('{0}/install', steps.installer-tarball-url.outputs.installer-url) }}
|
||||||
install_options: "--tarball-url-prefix http://localhost:8126/"
|
install_options: ${{ format('--tarball-url-prefix {0}', steps.installer-tarball-url.outputs.installer-url) }}
|
||||||
- run: sudo apt install fish zsh
|
- run: sudo apt install fish zsh
|
||||||
if: matrix.os == 'linux'
|
if: matrix.os == 'linux'
|
||||||
- run: brew install fish
|
- run: brew install fish
|
||||||
|
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
if [[ ! -d out ]]; then
|
|
||||||
echo "run prepare-installer-for-github-actions first"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd out
|
|
||||||
PORT=${PORT:-8126}
|
|
||||||
nohup python -m http.server "$PORT" >/dev/null 2>&1 &
|
|
||||||
pid=$!
|
|
||||||
|
|
||||||
while ! curl -s "http://localhost:$PORT"; do
|
|
||||||
sleep 1
|
|
||||||
if ! kill -0 $pid; then
|
|
||||||
echo "Failed to start http server"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo 'To install nix, run the following command:'
|
|
||||||
echo "sh <(curl http://localhost:$PORT/install) --tarball-url-prefix http://localhost:$PORT"
|
|
Reference in New Issue
Block a user