ipfs/ipfs-cluster

View on GitHub
.github/workflows/tests.yml

Summary

Maintainability
Test Coverage
name: Tests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master, dependency-upgrades ]

env:
  GO: 1.21.4

jobs:
  tests-all:
    name: "All modules + Coverage"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: "Tests"
      run: go test -v -timeout 15m -coverprofile=coverage.txt -covermode=atomic ./...

    - name: "Coverage"
      uses: codecov/codecov-action@v2

  tests-raft:
    name: "Using Raft"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: "Tests"
      run: go test -v -timeout 15m -failfast -consensus raft .

  tests-leveldb:
    name: "Using LevelDB"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: "Tests"
      run: go test -v -timeout 15m -failfast -datastore leveldb .

  tests-badger3:
    name: "Using Badger3"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: "Tests"
      run: go test -v -timeout 15m -failfast -datastore badger3 .

  tests-badger:
    name: "Using Badger"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: "Tests"
      run: go test -v -timeout 15m -failfast -datastore badger .

      
  tests-check:
    name: "Build, syntax and spelling checks"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: Install staticcheck
      run: go install honnef.co/go/tools/cmd/staticcheck@latest

    - name: Install misspell
      run: go install github.com/client9/misspell/cmd/misspell@latest

    - name: Check
      run: make check

    - name: Build binaries
      run: make build

  docker:
    name: "Docker build"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Docker builds
      run: make docker

  docker-compose:
    name: "Docker Compose"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Docker compose
      run: make docker-compose

  sharness:
    name: Sharness
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ env.GO }}

    - name: Apt-get update
      run: sudo apt-get update

    - name: Install jq and curl
      run: sudo apt-get install -y jq curl

    - name: Make install
      run: make install

    - name: Pull kubo
      run: docker pull ipfs/kubo

    - name: Sharness
      run: make test_sharness