GithubHelp home page GithubHelp logo

ibnesayeed / setup-ipfs Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 7.0 1 MB

A GitHub Action to install and initialize IPFS

License: MIT License

JavaScript 100.00%
ipfs ipfs-setup ipfs-installation github-actions actions github-workflow cicd testing javascript javascript-action

setup-ipfs's Introduction

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:

- uses: ibnesayeed/setup-ipfs@master

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

- uses: ibnesayeed/setup-ipfs@master
  with:
    ipfs_version: ^0.4

Automatically booting the IPFS API service after installation and initialization:

- uses: ibnesayeed/setup-ipfs@master
  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.4
          - 0.5
          - 0.6
    runs-on: ${{ matrix.os }}
    name: Test on ${{ matrix.os }} with IPFS ${{ matrix.ipfs }}
    steps:
      - name: Set up IPFS ${{ matrix.ipfs }}
        uses: ibnesayeed/setup-ipfs@master
        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 }}")'

See this example in action.

setup-ipfs's People

Contributors

dependabot[bot] avatar ibnesayeed avatar luizirber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

setup-ipfs's Issues

using ipfs daemon during action

Hello!

I have the following github action test on my caravela repository.

name: Units

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test-in-matrix:
    strategy:
      matrix:
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest

    runs-on: ${{ matrix.os }}
    name: Tests in ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v2
    
    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17
    
    - name: Set up IPFS
      uses: ibnesayeed/setup-ipfs@master
      with:
        run_daemon: true
      
    - name: Test
      run: make test

This works locally on Ubuntu 20.04 using act, but when pushed to github itself, the daemon doesn't appear to be able to make external connections and so the action fails.

Thanks in advance!

cannot publish cid to ipns anymore

I successfully used your github action for quite some time and was using it to publish to ipns a cid that was generated, but now i get the steps in the action that publish the cid as taking too much time so the workflow gets terminated.
the steps report : {"Version":"0.6.0","Commit":"","Repo":"10","System":"amd64/linux","Golang":"go1.14.4"}
Do you have any idea what could be causing the publishing on ipns to hang?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.