retch-cli 0.18.4

A fast, feature-rich system information fetcher written in Rust (similar to fastfetch or neofetch)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
name: Continuous Benchmarking

on:
  push:
    branches: [ "main" ]

# The five benchmark jobs below run in PARALLEL and hand their results to one `publish` job,
# because every publish writes the same dev/bench/data.js on the same branch. That serialises
# the writes within a run. It does NOT serialise them across runs: two merges to main in quick
# succession would start two runs that both publish. `needs:` never covered that -- it orders
# jobs inside a run and nothing else -- so the concurrency group is what does.
#
# cancel-in-progress is deliberately false: a benchmark run that is cancelled half way has
# already spent the runner time, and its results are still wanted.
concurrency:
  group: continuous-benchmarking
  cancel-in-progress: false

permissions:
  contents: write
  deployments: write

env:
  CARGO_TERM_COLOR: always

jobs:
  benchmark-linux-x64:
    name: Benchmark Linux x64
    runs-on: ubuntu-latest
    container: fedora:latest
    steps:
      - name: Install dependencies (Fedora)
        run: |
          dnf install -y git curl gcc make sqlite-devel python3
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
          git config --global --add safe.directory '*'

      - uses: actions/checkout@v7.0.1

      - name: Install fastfetch and hyperfine
        run: |
          python3 scripts/install_fastfetch.py
          python3 scripts/install_hyperfine.py

      - name: Build release binary
        run: cargo build --release

      - name: Run benchmarks
        run: |
          cargo bench
          hyperfine --warmup 3 --runs 10 './target/release/retch' 'fastfetch' --export-json hyperfine_default.json
          hyperfine --warmup 3 --runs 10 './target/release/retch --short' 'fastfetch -c none' --export-json hyperfine_short.json
          hyperfine --warmup 3 --runs 10 './target/release/retch --long' 'fastfetch -c all' --export-json hyperfine_long.json
          python3 scripts/parse_criterion.py

      # Publishing is deferred to the `publish` job so these five can run in
      # parallel; see the comment at the top of this file.
      - name: Upload benchmark result
        uses: actions/upload-artifact@v7
        with:
          name: bench-result-linux-x64
          path: benchmark_result.json
          if-no-files-found: error

  benchmark-linux-arm:
    name: Benchmark Linux arm64
    runs-on: ubuntu-24.04-arm
    container: fedora:latest
    steps:
      - name: Install dependencies (Fedora)
        run: |
          dnf install -y git curl gcc make sqlite-devel python3
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
          git config --global --add safe.directory '*'

      - uses: actions/checkout@v7.0.1

      - name: Install fastfetch and hyperfine
        run: |
          python3 scripts/install_fastfetch.py
          python3 scripts/install_hyperfine.py

      - name: Build release binary
        run: cargo build --release

      - name: Run benchmarks
        run: |
          cargo bench
          hyperfine --warmup 3 --runs 10 './target/release/retch' 'fastfetch' --export-json hyperfine_default.json
          hyperfine --warmup 3 --runs 10 './target/release/retch --short' 'fastfetch -c none' --export-json hyperfine_short.json
          hyperfine --warmup 3 --runs 10 './target/release/retch --long' 'fastfetch -c all' --export-json hyperfine_long.json
          python3 scripts/parse_criterion.py

      # Publishing is deferred to the `publish` job so these five can run in
      # parallel; see the comment at the top of this file.
      - name: Upload benchmark result
        uses: actions/upload-artifact@v7
        with:
          name: bench-result-linux-arm
          path: benchmark_result.json
          if-no-files-found: error

  benchmark-macos-arm:
    name: Benchmark macOS arm64
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v7.0.1

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Untap aws/tap (cosmetic — pre-tapped on the runner image, unrelated to this job, and untrusted-tap warnings clutter the Actions summary)
        run: brew untap aws/tap || true

      - name: Install fastfetch and hyperfine
        run: |
          python3 scripts/install_fastfetch.py
          python3 scripts/install_hyperfine.py

      - name: Build release binary
        run: cargo build --release

      - name: Run benchmarks
        run: |
          cargo bench
          hyperfine --warmup 3 --runs 10 './target/release/retch' 'fastfetch' --export-json hyperfine_default.json
          hyperfine --warmup 3 --runs 10 './target/release/retch --short' 'fastfetch -c none' --export-json hyperfine_short.json
          hyperfine --warmup 3 --runs 10 './target/release/retch --long' 'fastfetch -c all' --export-json hyperfine_long.json
          python3 scripts/parse_criterion.py

      # Publishing is deferred to the `publish` job so these five can run in
      # parallel; see the comment at the top of this file.
      - name: Upload benchmark result
        uses: actions/upload-artifact@v7
        with:
          name: bench-result-macos-arm
          path: benchmark_result.json
          if-no-files-found: error

  benchmark-windows-x64:
    name: Benchmark Windows x64
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v7.0.1

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Configure Windows PATH
        run: |
          echo "${env:USERPROFILE}\.cargo\bin" >> $env:GITHUB_PATH
          echo "${env:USERPROFILE}\bin" >> $env:GITHUB_PATH
          echo "${env:USERPROFILE}\scoop\shims" >> $env:GITHUB_PATH
          echo "${env:LOCALAPPDATA}\Microsoft\WinGet\Links" >> $env:GITHUB_PATH
        shell: pwsh

      - name: Install fastfetch and hyperfine
        run: |
          python scripts/install_fastfetch.py
          python scripts/install_hyperfine.py

      - name: Build release binary
        run: cargo build --release

      - name: Run benchmarks
        run: |
          cargo bench
          hyperfine --warmup 3 --runs 10 '.\target\release\retch.exe' 'fastfetch' --export-json hyperfine_default.json
          hyperfine --warmup 3 --runs 10 '.\target\release\retch.exe --short' 'fastfetch -c none' --export-json hyperfine_short.json
          hyperfine --warmup 3 --runs 10 '.\target\release\retch.exe --long' 'fastfetch -c all' --export-json hyperfine_long.json
          python scripts/parse_criterion.py

      # Publishing is deferred to the `publish` job so these five can run in
      # parallel; see the comment at the top of this file.
      - name: Upload benchmark result
        uses: actions/upload-artifact@v7
        with:
          name: bench-result-windows-x64
          path: benchmark_result.json
          if-no-files-found: error

  benchmark-windows-arm:
    name: Benchmark Windows arm64
    runs-on: windows-11-arm
    steps:
      - uses: actions/checkout@v7.0.1

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Configure Windows PATH
        run: |
          echo "${env:USERPROFILE}\.cargo\bin" >> $env:GITHUB_PATH
          echo "${env:USERPROFILE}\bin" >> $env:GITHUB_PATH
          echo "${env:USERPROFILE}\scoop\shims" >> $env:GITHUB_PATH
          echo "${env:LOCALAPPDATA}\Microsoft\WinGet\Links" >> $env:GITHUB_PATH
        shell: pwsh

      - name: Install fastfetch and hyperfine
        run: |
          python scripts/install_fastfetch.py
          python scripts/install_hyperfine.py

      - name: Build release binary
        run: cargo build --release

      - name: Run benchmarks
        run: |
          cargo bench
          hyperfine --warmup 3 --runs 10 '.\target\release\retch.exe' 'fastfetch' --export-json hyperfine_default.json
          hyperfine --warmup 3 --runs 10 '.\target\release\retch.exe --short' 'fastfetch -c none' --export-json hyperfine_short.json
          hyperfine --warmup 3 --runs 10 '.\target\release\retch.exe --long' 'fastfetch -c all' --export-json hyperfine_long.json
          python scripts/parse_criterion.py

      # Publishing is deferred to the `publish` job so these five can run in
      # parallel; see the comment at the top of this file.
      - name: Upload benchmark result
        uses: actions/upload-artifact@v7
        with:
          name: bench-result-windows-arm
          path: benchmark_result.json
          if-no-files-found: error

  # ONE publisher for all five platforms.
  #
  # Every `Publish ...` step below writes the same dev/bench/data.js on the same branch, so
  # they must not run concurrently -- which is exactly why the five benchmark jobs used to be
  # chained. Running them as sequential STEPS of one job keeps that guarantee while letting
  # the expensive half run in parallel: measured on run 35745177092, the chain cost 39.1 min
  # of wall clock against a 9.7 min longest job.
  #
  # Invoking the action repeatedly in one job is its documented pattern -- its README says to
  # give each step a distinct `name` when a workflow has several. `auto-push: false` on each,
  # then a single push at the end, so five appends become one commit-and-push rather than five
  # races-with-ourselves.
  publish:
    name: Publish benchmark results
    needs:
      - benchmark-linux-x64
      - benchmark-linux-arm
      - benchmark-macos-arm
      - benchmark-windows-x64
      - benchmark-windows-arm
    # Runs unless the whole run was cancelled, so a single failed platform does not discard
    # the other four results. Each step below is guarded on its own artifact.
    if: ${{ !cancelled() }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7.0.1

      - name: Download benchmark results
        uses: actions/download-artifact@v8
        with:
          path: bench-results
          pattern: bench-result-*
          # NOT merge-multiple: every artifact holds a file called benchmark_result.json, so
          # merging them into one directory would have them overwrite each other.
          merge-multiple: false

      # Fetch gh-pages ONCE, here, rather than letting each publish step do it.
      #
      # github-action-benchmark normally starts by running
      # `git fetch origin gh-pages:gh-pages`. With auto-push: false that is fine for the FIRST
      # step and fatal for the second: step one leaves the local branch a commit ahead of
      # origin, so step two's fetch is a non-fast-forward and the job dies with
      # `! [rejected] gh-pages -> gh-pages (non-fast-forward)`. That is exactly how run
      # 35767546659 failed -- the five benchmark jobs all succeeded and `Publish Linux arm64`
      # took the whole publish down 13 seconds in.
      #
      # So every publish step below sets skip-fetch-gh-pages: true and this does the fetch.
      # ALL of them skip it, not just the ones after the first: each step is guarded on its own
      # artifact, so whichever runs first is not fixed.
      - name: Fetch gh-pages
        run: |
          set -euo pipefail
          if git ls-remote --exit-code --heads origin gh-pages >/dev/null 2>&1; then
            git fetch origin gh-pages:gh-pages
          else
            echo "origin has no gh-pages branch yet; the first publish will create it."
          fi

      # Guarded on the artifact existing rather than on the job succeeding, so one broken
      # platform costs only its own series. Before this workflow was parallelised each job
      # published for itself, and a Windows failure lost Windows alone; keeping that is the
      # point of `!cancelled()` above plus this condition.
      - name: Publish Linux x64
        if: hashFiles('bench-results/bench-result-linux-x64/benchmark_result.json') != ''
        uses: benchmark-action/github-action-benchmark@v1
        with:
          name: "Linux x64 Benchmarks"
          tool: 'customSmallerIsBetter'
          output-file-path: bench-results/bench-result-linux-x64/benchmark_result.json
          github-token: ${{ secrets.GITHUB_TOKEN }}
          auto-push: false
          gh-pages-branch: gh-pages
          benchmark-data-dir-path: dev/bench
          alert-threshold: '200%'
          fail-on-alert: false
          comment-on-alert: true
          alert-comment-cc-users: '@l1a'
          max-items-in-chart: 50
          # See the 'Fetch gh-pages' step above: the action's own fetch is a
          # non-fast-forward once an earlier step has committed locally.
          skip-fetch-gh-pages: true

      # Guarded on the artifact existing rather than on the job succeeding, so one broken
      # platform costs only its own series. Before this workflow was parallelised each job
      # published for itself, and a Windows failure lost Windows alone; keeping that is the
      # point of `!cancelled()` above plus this condition.
      - name: Publish Linux arm64
        if: hashFiles('bench-results/bench-result-linux-arm/benchmark_result.json') != ''
        uses: benchmark-action/github-action-benchmark@v1
        with:
          name: "Linux Arm64 Benchmarks"
          tool: 'customSmallerIsBetter'
          output-file-path: bench-results/bench-result-linux-arm/benchmark_result.json
          github-token: ${{ secrets.GITHUB_TOKEN }}
          auto-push: false
          gh-pages-branch: gh-pages
          benchmark-data-dir-path: dev/bench
          alert-threshold: '200%'
          fail-on-alert: false
          comment-on-alert: true
          alert-comment-cc-users: '@l1a'
          max-items-in-chart: 50
          # See the 'Fetch gh-pages' step above: the action's own fetch is a
          # non-fast-forward once an earlier step has committed locally.
          skip-fetch-gh-pages: true

      # Guarded on the artifact existing rather than on the job succeeding, so one broken
      # platform costs only its own series. Before this workflow was parallelised each job
      # published for itself, and a Windows failure lost Windows alone; keeping that is the
      # point of `!cancelled()` above plus this condition.
      - name: Publish macOS arm64
        if: hashFiles('bench-results/bench-result-macos-arm/benchmark_result.json') != ''
        uses: benchmark-action/github-action-benchmark@v1
        with:
          name: "macOS Arm64 Benchmarks"
          tool: 'customSmallerIsBetter'
          output-file-path: bench-results/bench-result-macos-arm/benchmark_result.json
          github-token: ${{ secrets.GITHUB_TOKEN }}
          auto-push: false
          gh-pages-branch: gh-pages
          benchmark-data-dir-path: dev/bench
          alert-threshold: '200%'
          fail-on-alert: false
          comment-on-alert: true
          alert-comment-cc-users: '@l1a'
          max-items-in-chart: 50
          # See the 'Fetch gh-pages' step above: the action's own fetch is a
          # non-fast-forward once an earlier step has committed locally.
          skip-fetch-gh-pages: true

      # Guarded on the artifact existing rather than on the job succeeding, so one broken
      # platform costs only its own series. Before this workflow was parallelised each job
      # published for itself, and a Windows failure lost Windows alone; keeping that is the
      # point of `!cancelled()` above plus this condition.
      - name: Publish Windows x64
        if: hashFiles('bench-results/bench-result-windows-x64/benchmark_result.json') != ''
        uses: benchmark-action/github-action-benchmark@v1
        with:
          name: "Windows x64 Benchmarks"
          tool: 'customSmallerIsBetter'
          output-file-path: bench-results/bench-result-windows-x64/benchmark_result.json
          github-token: ${{ secrets.GITHUB_TOKEN }}
          auto-push: false
          gh-pages-branch: gh-pages
          benchmark-data-dir-path: dev/bench
          alert-threshold: '200%'
          fail-on-alert: false
          comment-on-alert: true
          alert-comment-cc-users: '@l1a'
          max-items-in-chart: 50
          # See the 'Fetch gh-pages' step above: the action's own fetch is a
          # non-fast-forward once an earlier step has committed locally.
          skip-fetch-gh-pages: true

      # Guarded on the artifact existing rather than on the job succeeding, so one broken
      # platform costs only its own series. Before this workflow was parallelised each job
      # published for itself, and a Windows failure lost Windows alone; keeping that is the
      # point of `!cancelled()` above plus this condition.
      - name: Publish Windows arm64
        if: hashFiles('bench-results/bench-result-windows-arm/benchmark_result.json') != ''
        uses: benchmark-action/github-action-benchmark@v1
        with:
          name: "Windows Arm64 Benchmarks"
          tool: 'customSmallerIsBetter'
          output-file-path: bench-results/bench-result-windows-arm/benchmark_result.json
          github-token: ${{ secrets.GITHUB_TOKEN }}
          auto-push: false
          gh-pages-branch: gh-pages
          benchmark-data-dir-path: dev/bench
          alert-threshold: '200%'
          fail-on-alert: false
          comment-on-alert: true
          alert-comment-cc-users: '@l1a'
          max-items-in-chart: 50
          # See the 'Fetch gh-pages' step above: the action's own fetch is a
          # non-fast-forward once an earlier step has committed locally.
          skip-fetch-gh-pages: true

      - name: Push benchmark results
        run: |
          set -euo pipefail
          # The action committed to the local gh-pages branch without pushing (auto-push:
          # false). If every Publish step above was skipped there is nothing to push, and
          # `git push` on an up-to-date ref exits 0, so this needs no special case.
          if ! git rev-parse --verify --quiet gh-pages >/dev/null; then
            echo "No local gh-pages branch -- every publish step was skipped. Nothing to push."
            exit 0
          fi
          git push origin gh-pages:gh-pages