Skip to content

Commit

Permalink
add hyperfine
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwn committed Jul 27, 2024
1 parent 3706961 commit 2f37624
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 47 deletions.
10 changes: 6 additions & 4 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ cue:
checksum: "sha256:3ae7b28e12de2e0554c28d9a9eb3dd919f0640274c925ba0e36de9079af80de2"
delta:
release: "0.16.5"
emacs:
release: "29.1"
go:
release: "1.22.3"
checksum: "sha256:8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36"
hyperfine:
release: v1.18.0
kitty:
release: "0.29.2"
lazygit:
release: "0.43.1"
nerd_fonts:
release: "v3.0.2"
release: "v3.2.0"
fonts:
- "ComicShannsMono"
- "JetBrainsMono"
- "Iosevka"
- "RobotoMono"
nvim_nightly:
release: "nightly"
nvim:
release: "v0.9.5"
release: "v0.10.0"
python:
versions:
- semver: "3.6.15"
Expand Down
1 change: 1 addition & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- ansible_distribution == {{ ansible_distribution }}
- ansible_distribution_major_version ==
{{ ansible_distribution_major_version }}
- ansible_architecture == {{ ansible_architecture }}
tags:
- always

Expand Down
32 changes: 0 additions & 32 deletions tasks/emacs.yml

This file was deleted.

53 changes: 53 additions & 0 deletions tasks/hyperfine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
- name: Hyperfine - Remove previous installation
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- "{{ ansible_env.HOME }}/opt/hyperfine"
- "/tmp/hyperfine"
- "/tmp/hyperfine-x86_64-unknown-linux-gnu.tar.gz"

- name: Hyperfine - Download release
ansible.builtin.get_url:
url: "https://github.com/sharkdp/hyperfine/releases/download/{{ hyperfine.release }}/hyperfine-{{ hyperfine.release }}-x86_64-unknown-linux-gnu.tar.gz"
dest: "/tmp/hyperfine-x86_64-unknown-linux-gnu.tar.gz"
mode: u=rw,g=rw,o=r

- name: Hyperfine - Create installation directory
ansible.builtin.file:
path: "/tmp/hyperfine"
state: directory
mode: u=rwx,g=rwx,o=rx

- name: Hyperfine - Extract
ansible.builtin.unarchive:
src: "/tmp/hyperfine-x86_64-unknown-linux-gnu.tar.gz"
dest: "/tmp/hyperfine"
remote_src: true

- name: Hyperfine - Move installation to opt
ansible.builtin.copy:
src: "/tmp/hyperfine/hyperfine-{{ hyperfine.release }}-x86_64-unknown-linux-gnu"
dest: "{{ ansible_env.HOME }}/opt"
mode: u=rwx,g=rwx,o=rx
remote_src: true

- name: Clean up
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- "/tmp/hyperfine"
- "/tmp/hyperfine-x86_64-unknown-linux-gnu.tar.gz"

- name: Ensure ansible zsh file exists.

Check failure on line 44 in tasks/hyperfine.yml

View workflow job for this annotation

GitHub Actions / Lint

risky-file-permissions

File permissions unset or incorrect.
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.config/zsh/ansible.zsh"
state: touch

- name: Add hyperfine to PATH
ansible.builtin.blockinfile:
path: "{{ ansible_env.HOME }}/.config/zsh/ansible.zsh"
block: |
export PATH="$PATH:$HOME/opt/hyperfine-{{ hyperfine.release }}-x86_64-unknown-linux-gnu"
2 changes: 1 addition & 1 deletion tasks/lazygit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
path: "{{ item }}"
state: absent
loop:
- "{{ ansible_env.HOME }}/opt/delta"
- "{{ ansible_env.HOME }}/opt/lazygit"
- "/tmp/lazygit"
- "/tmp/lazygit_{{ lazygit.release }}_Linux_x86_64.tar.gz"

Expand Down
15 changes: 5 additions & 10 deletions u22-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
tags:
- cargo

# - name: Install emacs
# ansible.builtin.import_tasks: "tasks/emacs.yml"
# tags:
# - emacs

- name: Install starship.
ansible.builtin.import_tasks: "tasks/starship.yml"
tags:
Expand All @@ -85,6 +80,11 @@
tags:
- cue

- name: Install hyperfine.
ansible.builtin.import_tasks: "tasks/hyperfine.yml"
tags:
- hyperfine

- name: Install wez.
ansible.builtin.import_tasks: "tasks/wez.yml"
tags:
Expand All @@ -109,8 +109,3 @@
ansible.builtin.import_tasks: "tasks/souffle.yml"
tags:
- souffle

- name: Install emacs.
ansible.builtin.import_tasks: "tasks/emacs.yml"
tags:
- emacs

0 comments on commit 2f37624

Please sign in to comment.