Giter Club home page Giter Club logo

bootstack-actions's Introduction

BootStack GitHub actions

These actions are meant to be used for unifying lint, unit and functional tests, charm and snap releases, and sonar integration in GitHub workflows. At the same time, workflows that can be directly used will also be found in this repo.

Repo configuration workflow

Charm release workflow

Snap release workflow

This workflow builds and releases a snap to the Snap Store after passing lint, unit and functional tests. The triggering workflow (from the source repo) can specify one or multiple channel(s) as an input when calling the reusable workflow to properly release the snap.

Pull request workflow

Sonar workflow

For the workflow to be fully functional, you must complete the following steps.

Registration

  1. Go to sonarcloud and register with github.
  2. After registration, send username to one of the current administrators( Erhan Sunar Robert Gildein Sudeep Bhandari ).
  3. We will add you to bootstack-devops project as Admin
  4. From now on you will be able to add projects.

Adding Sonar Projects

  1. From the top right corner press the (+) icon.
  2. Then press “Analyze new project”
  3. From the bottom right corner press “create a project manually”
  4. Select the bootstack-devops as organization and enter the “Project key” and “Display name” as our project name in github.
  5. Press “Set Up”
  6. Continue “With Github Actions”
  7. Go to Github project and add secret shown in previous page
  8. On the second step do not copy the file, but use the sonar.yaml from this repo
  9. On github, create an access token for yourself with following permissions
    • pull-requests: read # allows SonarCloud to decorate PRs with analysis results
  10. Add this token as a secret in github project as GH_TOKEN like step 7

Project Changes

  1. Change relevant parts to create coverage.xml with tests/unit/report/coverage.xml path

    1. First add --cov-report=xml to unit tests. Example (tox.ini)
      [testenv:unit]
      commands = pytest {toxinidir}/tests/unit \
          {posargs:-v --cov --cov-report=term-missing --cov-report=html --cov-report=xml}
  2. Then add coverage parts to you configuration. Example (pyproject.yaml)

    [tool.coverage.run]
    relative_files = true
    
    [tool.coverage.xml]
    output = "tests/unit/report/coverage.xml"
  3. Add sonar-project.properties file. Example:

     sonar.python.version=3
     sonar.projectKey=your-project-name
     sonar.organization=bootstack-devops
     sonar.python.coverage.reportPaths=tests/unit/report/coverage.xml
     sonar.sources = src/
     sonar.tests = tests/
     sonar.test.inclusions = test/**
     sonar.coverage.exclusions=tests/**, docs/**, contrib/**, snap/**, *

bootstack-actions's People

Contributors

agileshaw avatar esunar avatar gabrielcocenza avatar kang-makes avatar rgildein 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.