Freqtrade TUI CI workflow (freqtrade/ftui)
The Freqtrade TUI CI workflow from freqtrade/ftui, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get caching, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Freqtrade TUI CI workflow from the freqtrade/ftui repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Freqtrade TUI CI
on:
push:
branches:
- main
- ci/*
release:
types: [published]
pull_request:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}"
cancel-in-progress: true
permissions:
repository-projects: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15", "windows-latest" ]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
pip install ruff
- name: Test execution (for now with `--help`)
run: |
ftui --help
- name: Run Ruff
run: |
ruff check --output-format=github
# - name: Run Ruff format check
# run: |
# ruff format --check
publish:
name: "Deploy to pypi"
if: (github.event_name == 'release')
environment:
name: release
url: https://pypi.org/p/ftui
permissions:
id-token: write
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install build
- name: Build package
run: |
pip install -U build
python -m build
- name: Publish to PyPI (Test)
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
attestations: false # https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Freqtrade TUI CI on: push: branches: - main - ci/* release: types: [published] pull_request: concurrency: group: "${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}" cancel-in-progress: true permissions: repository-projects: read jobs: build: timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: matrix: os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15", "windows-latest" ] python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: cache: 'pip' python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install . pip install ruff - name: Test execution (for now with `--help`) run: | ftui --help - name: Run Ruff run: | ruff check --output-format=github # - name: Run Ruff format check # run: | # ruff format --check publish: timeout-minutes: 30 name: "Deploy to pypi" if: (github.event_name == 'release') environment: name: release url: https://pypi.org/p/ftui permissions: id-token: write needs: build runs-on: latchkey-small steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: cache: 'pip' python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install build - name: Build package run: | pip install -U build python -m build - name: Publish to PyPI (Test) uses: pypa/gh-action-pypi-publish@v1.13.0 with: repository-url: https://test.pypi.org/legacy/ skip-existing: true attestations: false # https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440 - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.13.0
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 2 jobs (26 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.