Last active
April 13, 2023 20:31
-
-
Save aakropotkin/5fea88951b81aac0906cab2f887a425e to your computer and use it in GitHub Desktop.
flox install in github actions
This file contains 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: "Flox Tests" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
# ---------------------------------------------------------------------------- # | |
jobs: | |
all-tests: | |
runs-on: ubuntu-latest | |
env: | |
SYSTEM: x86_64-linux | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
steps: | |
- 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.05 | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
substituters = https://cache.nixos.org | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= flox-store-public-0:8c/B+kjIaQ+BloCmNkRUKwaVPFWkriSAd0JJvuDu4F0= | |
trusted-substituters = https://cache.floxdev.com | |
max-jobs = auto | |
cores = 0 | |
substitute = true | |
builders-use-substitutes = true | |
fallback = true | |
connect-timeout = 5 | |
stalled-download-timeout = 90 | |
timeout = 0 | |
# ---------------------------------------------------------------------------- # | |
- name: Git and SSH Setup | |
run: | | |
set -eu; | |
set -o pipefail; | |
mkdir -p /home/runner/.ssh; | |
ssh-keyscan github.com >> /home/runner/.ssh/known_hosts; | |
ssh-keygen -f /home/runner/.ssh/id_rsa -t rsa -N '' \ | |
-C [email protected]; | |
chmod 600 /home/runner/.ssh/id_rsa; | |
ssh-agent -a "$SSH_AUTH_SOCK" > /dev/null; | |
ssh-add /home/runner/.ssh/id_rsa; | |
git config --global user.email "[email protected]"; | |
git config --global user.name "Flox GitHubActions"; | |
# ---------------------------------------------------------------------------- # | |
- uses: actions/checkout@v3 | |
# ---------------------------------------------------------------------------- # | |
- name: Intall Flox | |
run: | | |
set -eu; | |
set -o pipefail; | |
nix profile install --impure \ | |
--experimental-features "nix-command flakes" \ | |
--accept-flake-config \ | |
'github:flox/floxpkgs#flox.fromCatalog' \ | |
; | |
# ---------------------------------------------------------------------------- # | |
- name: Use Flox | |
run: | | |
set -eu; | |
set -o pipefail; | |
flox install hello; | |
. <( flox activate; ); | |
hello; | |
# ---------------------------------------------------------------------------- # | |
# | |
# | |
# | |
# ============================================================================ # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment