Giter VIP home page Giter VIP logo

elixir-coverage-feedback-action's Introduction

Elixir coverage feedback comment

This action gets the output of mix test --cover, treats it, and creates a feedback message in the pull request of origin. It also checks if the coverage reaches the minimum configured in the action, and exits with an error if it doesn't.

By default, this action assumes that you are using the Elixir's default coverage tool. But it also supports ExCoveralls, and if you preferes it, just add the coverage_tool configuration inside the with option specifying it.

image

Example of a complete test workflow using the action

.github/workflows/test.yml

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    name: Tests & Checks
    env:
      MIX_ENV: test
    services:
      db:
        image: postgres:14-alpine
        ports: ["5432:5432"]
        env:
          POSTGRES_DB: project_test
          POSTGRES_USER: project
          POSTGRES_PASSWORD: mycoolpassword
    steps:
      - uses: actions/checkout@v3
      - uses: erlef/[email protected]
        with:
          elixir-version: "1.14.0"
          otp-version: "25.0.4"
      - name: Mix and build cache
        uses: actions/cache@v3
        with:
          path: |
            deps
            _build
          key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
          restore-keys: ${{ runner.os }}-mix-
      - name: Get dependencies
        run: mix deps.get
      - name: Code analyzers
        run: |
          mix format --check-formatted
          mix credo --strict
          mix compile --warnings-as-errors
      - name: Tests & Coverage
        uses: josecfreittas/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          coverage_threshold: 80
          # coverage_tool: excoveralls

elixir-coverage-feedback-action's People

Contributors

josecfreittas avatar

Watchers

 avatar

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.