Skip to content

Commit

Permalink
try using a checkout to install
Browse files Browse the repository at this point in the history
  • Loading branch information
aakropotkin committed Jun 28, 2023
1 parent 459a419 commit 3473825
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/compare-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@11f4ad19be46fd34c005a2864996d8f197fb51c6
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixpkgs-22.11
install_url: https://releases.nixos.org/nix/nix-2.16.1/install
nix_path: nixpkgs=channel:nixpkgs-23.05
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
Expand All @@ -42,7 +42,7 @@ jobs:
run: |
set -eu;
set -o pipefail;
nix registry pin nixpkgs github:NixOS/nixpkgs/22.11;
nix registry pin nixpkgs github:NixOS/nixpkgs/23.05;
- name: SQLite3 pkg-config Test
shell: bash
Expand All @@ -60,12 +60,9 @@ jobs:
echo "selfURI: $selfURI" >&2;
echo "Installing deps" >&2;
SYSTEM="$( nix eval --raw --impure --expr builtins.currentSystem; )";
nix profile install \
'nixpkgs#sqlite^bin,out,dev' \
'nixpkgs#pkg-config' \
"$selfURI#packages.$SYSTEM.etc-profiles" \
;
nix profile install 'nixpkgs#sqlite^bin,out,dev';
nix profile install 'nixpkgs#pkg-config';
nix profile install "$selfURI#etc-profiles";
export FLOX_ENV="$HOME/.nix-profile";
. "$FLOX_ENV/etc/profile";
Expand Down
35 changes: 7 additions & 28 deletions .github/workflows/trivial-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ jobs:
- name: Install flox
uses: flox/[email protected]

- name: Setup Nix Registry
shell: bash
run: |
set -eu;
set -o pipefail;
nix registry pin nixpkgs github:NixOS/nixpkgs/22.11;
flox nix registry pin nixpkgs github:NixOS/nixpkgs/22.11;
- name: Checkout
uses: actions/checkout@v3

- name: Make Injector
shell: bash
Expand Down Expand Up @@ -83,40 +78,24 @@ jobs:
echo "Installing deps" >&2;
flox install -e sqlite-dev pkg-config;
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
selfURI="github:${{ github.repository }}";
else
selfURI="github:${{ github.repository }}/$GITHUB_REF";
fi
echo "selfURI: $selfURI" >&2;
echo "Installing locally defined deps" >&2;
SYSTEM="$( nix eval --raw --impure --expr builtins.currentSystem; )";
flox install -e sqlite-dev "$selfURI#packages.$SYSTEM.etc-profiles";
flox install -e sqlite-dev etc-profiles;
# Have to work around a bunch of unset variables that get us killed
# when `set -eu; set -o pipefail;' is active.
export PS0=;
export PS1='\s-\v$ ';
export PS2='> ';
export PS3='>';
export PS4='+';
export FLOX_SAVE_PS1=;
ansifilter() { cat -; }
export -f ansifilter;
export _ansifilter=ansifilter;
runEnv() { flox activate -e sqlite-dev -- "$@"; }
echo "Activating env" >&2;
. <( flox activate -e sqlite-dev; );
runEnv :;
echo "Checking if pkg-config can find sqlite" >&2;
if pkg-config --list-all|grep '^sqlite3';
if runEnv pkg-config --list-all|grep '^sqlite3';
then
echo "PASS" >&2;
exit 0;
else
echo "FAIL" >&2;
echo "pkg-config --list results:" >&2;
echo "---" >&2;
pkg-config --list-all >&2;
runEnv pkg-config --list-all >&2;
echo "---" >&2;
exit 1;
fi

0 comments on commit 3473825

Please sign in to comment.