A GitHub Action to install and configure apt-fast on Ubuntu/Debian runners. apt-fast is a shell script wrapper for apt-get that dramatically speeds up package downloads by using parallel connections.
apt-fast accelerates apt package downloads by leveraging aria2c to download packages in parallel with multiple connections per package. This can significantly reduce CI/CD build times when installing dependencies.
Add this step to your workflow before installing packages:
- name: Setup apt-fast
uses: elijahr/setup-apt-fast@v1
- name: Install dependencies
run: |
sudo apt-fast update
sudo apt-fast install -y <all the things>All inputs are optional. The action uses sensible defaults optimized for GitHub Actions runners.
| Input | Description | Default |
|---|---|---|
apt-manager |
Package manager to use (apt-get, aptitude, or apt) |
apt-get |
max-downloads |
Maximum number of parallel downloads | 16 |
max-connections-per-server |
Maximum connections per server | 10 |
split-connections |
Maximum connections per file | 16 |
min-split-size |
Size of each split piece (e.g., 1M, 5M, 10M) |
1M |
piece-algorithm |
Piece selection algorithm (default, inorder, geom) |
default |
download-before |
Skip confirmation dialog (true/false) |
true |
mirrors |
Comma or space-separated list of mirror URLs | (empty) |
verbose-output |
Display detailed aria2 download information (true/false) |
false |
apt-auth |
Enable authentication for sources requiring login (true/false) |
true |
- name: Setup apt-fast
uses: elijahr/setup-apt-fast@v1- name: Setup apt-fast with custom settings
uses: elijahr/setup-apt-fast@v1
with:
max-downloads: 20
max-connections-per-server: 16
split-connections: 20
min-split-size: 5M
verbose-output: true- name: Setup apt-fast with mirrors
uses: elijahr/setup-apt-fast@v1
with:
mirrors: 'http://mirror1.example.com/ubuntu, http://mirror2.example.com/ubuntu'Standard apt-get installation:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libssl-dev
- name: Build project
run: makeWith apt-fast for faster downloads:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup apt-fast
uses: elijahr/setup-apt-fast@v1
- name: Install dependencies
run: |
sudo apt-fast update
sudo apt-fast install -y build-essential cmake libssl-dev
- name: Build project
run: makeFor maximum speed when installing many packages:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup apt-fast (high performance)
uses: elijahr/setup-apt-fast@v1
with:
max-downloads: 30
max-connections-per-server: 16
split-connections: 30
min-split-size: 10M
- name: Install dependencies
run: |
sudo apt-fast update
sudo apt-fast install -y build-essential cmake libssl-dev libboost-all-dev
- name: Build project
run: make- Ubuntu or Debian-based GitHub Actions runners
- Works with:
ubuntu-latest,ubuntu-22.04,ubuntu-20.04, etc.
This action:
- Verifies the runner is Ubuntu/Debian-based
- Installs required prerequisites
- Adds the official apt-fast PPA
- Installs apt-fast with your specified configuration
- Configures all apt-fast settings according to your inputs
- Displays a configuration summary for verification
After installation, use apt-fast instead of apt-get in your workflow commands.
apt-fast can significantly reduce package installation time, especially when installing many or large packages. The actual speedup depends on:
- Network bandwidth
- Mirror availability
- Number and size of packages being installed
Typical improvements range from 2-5x faster download speeds.
This repository uses pre-commit to ensure code quality and consistency. The hooks run automatically before each commit to check:
- YAML linting (yamllint)
- GitHub Actions linting (actionlint)
- Shell script linting (shellcheck)
- Shell script formatting (shfmt)
- Basic file checks (trailing whitespace, end-of-file, etc.)
Install pre-commit:
# Using pip
pip install pre-commit
# Or using homebrew (macOS)
brew install pre-commitInstall the git hooks:
pre-commit installThe hooks will run automatically on git commit. To run manually:
# Run on all files
pre-commit run --all-files
# Run on specific files
pre-commit run --files action.ymlTo skip hooks (not recommended):
git commit --no-verify.pre-commit-config.yaml- Pre-commit hook configuration.yamllint- YAML linting rules.shellcheckrc- Shell script linting configuration
MIT