项目作者: ibnesayeed

项目描述 :
A GitHub Action to install and initialize IPFS
高级语言: JavaScript
项目地址: git://github.com/ibnesayeed/setup-ipfs.git
创建时间: 2020-05-11T21:20:45Z
项目社区:https://github.com/ibnesayeed/setup-ipfs

开源协议:MIT License

下载


IPFS Setup Action

A GitHub Action to install and initialize 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.

Inputs

This action automatically detects runner platform features like the operating system and the processor architecture.

ipfs_version

IPFS version, automatically resolved to the best matching released binary as per the SemVer format (default: 0.6).

run_daemon

Whether to start IPFS service daemon after installation and initialization (default: false).

Outputs

The setup process sets some output variables to be utilized in any succeeding steps.

resolved_ipfs_version

Latest matching SemVer IPFS version installed.

ipfs_download_url

Utilized IPFS distribution download URL.

peer_id

Identity of the peer as reported on initialization.

welcome_ref

Hash of the Welcome object containing readme, help, and other files.

Example usage

A simple usage in jobs.<job_id>.steps with default latest IPFS version:

  1. - uses: ibnesayeed/setup-ipfs@master

Setting up a custom IPFS version (e.g., latest patch of IPFS 0.4.x):

  1. - uses: ibnesayeed/setup-ipfs@master
  2. with:
  3. ipfs_version: ^0.4

Automatically booting the IPFS API service after installation and initialization:

  1. - uses: ibnesayeed/setup-ipfs@master
  2. with:
  3. run_daemon: true

A comprehensive example with matrix setup to test against various virsions of IPFS on various platforms:

  1. jobs:
  2. test-in-matrix:
  3. strategy:
  4. matrix:
  5. os:
  6. - ubuntu-latest
  7. - macos-latest
  8. - windows-latest
  9. ipfs:
  10. - 0.4
  11. - 0.5
  12. - 0.6
  13. runs-on: ${{ matrix.os }}
  14. name: Test on ${{ matrix.os }} with IPFS ${{ matrix.ipfs }}
  15. steps:
  16. - name: Set up IPFS ${{ matrix.ipfs }}
  17. uses: ibnesayeed/setup-ipfs@master
  18. id: ipfs_setup
  19. with:
  20. ipfs_version: ${{ matrix.ipfs }}
  21. run_daemon: true
  22. - name: Test IPFS ${{ steps.ipfs_setup.outputs.resolved_ipfs_version }} CLI and API
  23. shell: bash
  24. run: |
  25. set -o pipefail
  26. ipfs cat ${{ steps.ipfs_setup.outputs.welcome_ref }}/readme
  27. curl -sX POST http://localhost:5001/api/v0/version | jq -e '(.Version=="${{ steps.ipfs_setup.outputs.resolved_ipfs_version }}")'

See this example in action.