GitHub Action
IPFS/Kubo Setup Action
A GitHub Action to install and initialize kubo (formally named go-ipfs
) to run an instance of InterPlanetary File System (IPFS) in all supported runner platforms.
This action aims to provide an environment to test DApps that rely on IPFS.
This action automatically detects runner platform features like the operating system and the processor architecture.
IPFS version, automatically resolved to the best matching released binary as per the SemVer format (default: 0.29
).
Whether to start IPFS service daemon after installation and initialization (default: false
).
The setup process sets some output variables to be utilized in any succeeding steps.
Latest matching SemVer IPFS version installed.
Utilized IPFS distribution download URL.
Identity of the peer as reported on initialization.
Hash of the Welcome object containing readme
, help
, and other files.
A simple usage in jobs.<job_id>.steps
with default latest IPFS version:
- uses: oduwsdl/setup-ipfs@main
Setting up a custom IPFS version (e.g., latest patch of IPFS 0.29.x
):
- uses: oduwsdl/setup-ipfs@main
with:
ipfs_version: ^0.29
Automatically booting the IPFS API service after installation and initialization:
- uses: oduwsdl/setup-ipfs@main
with:
run_daemon: true
A comprehensive example with matrix setup to test against various virsions of IPFS on various platforms:
jobs:
test-in-matrix:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
ipfs:
- 0.27
- 0.28
- 0.29
runs-on: ${{ matrix.os }}
name: Test on ${{ matrix.os }} with IPFS ${{ matrix.ipfs }}
steps:
- name: Set up IPFS ${{ matrix.ipfs }}
uses: oduwsdl/setup-ipfs@main
id: ipfs_setup
with:
ipfs_version: ${{ matrix.ipfs }}
run_daemon: true
- name: Test IPFS ${{ steps.ipfs_setup.outputs.resolved_ipfs_version }} CLI and API
shell: bash
run: |
set -o pipefail
ipfs cat ${{ steps.ipfs_setup.outputs.welcome_ref }}/readme
curl -sX POST http://localhost:5001/api/v0/version | jq -e '(.Version=="${{ steps.ipfs_setup.outputs.resolved_ipfs_version }}")'