Giter Club home page Giter Club logo

actions's Introduction

The Foreman GitHub Actions

This repository contains reusable workflows to reduce duplication in actions in the Foreman project.

At this moment it's considered experimental.

Rubocop

To call Rubocop within your CI, use the following workflow:

name: CI

on: pull_request

concurrency:
  group: ${{ github.ref_name }}-${{ github.workflow }}
  cancel-in-progress: true

jobs:
  rubocop:
    name: Rubocop
    uses: theforeman/actions/.github/workflows/rubocop.yml@v0

Foreman plugin tests

To run the Foreman tests once Rubocop has passed, use the following workflow:

name: CI

on: pull_request

concurrency:
  group: ${{ github.ref_name }}-${{ github.workflow }}
  cancel-in-progress: true

jobs:
  rubocop:
    name: Rubocop
    uses: theforeman/actions/.github/workflows/rubocop.yml@v0

  test:
    name: Ruby
    needs: rubocop
    uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0
    with:
      plugin: MY_PLUGIN

By default, this will run with the Ruby/NodeJS combination that is configured in Foreman's .github/matrix.json.

You can adjust this matrix by setting the matrix_include and matrix_exclude inputs to the workflow:

name: CI

on: pull_request

jobs:
  test:
    name: Ruby
    uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0
    with:
      plugin: MY_PLUGIN
      matrix_include: '[{"ruby": "3.0", "node": "20"}]'
      matrix_exclude: '[{"ruby": "2.5", "node": "10"}, {"ruby": "2.5", "node": "12"}]'

Gem test

To test a simple gem that only needs Ruby and bundler, use the following workflow:

name: CI

on: pull_request

concurrency:
  group: ${{ github.ref_name }}-${{ github.workflow }}
  cancel-in-progress: true

jobs:
  test:
    name: Tests
    uses: theforeman/actions/.github/workflows/test-gem.yml@v0

By default it uses bundle exec rake spec but it's possible to override the command:

jobs:
  test:
    name: Tests
    uses: theforeman/actions/.github/workflows/test-gem.yml@v0
    with:
      command: bundle exec rake test

Gem release

To release a gem, use the following workflow

name: Release

on:
  create:
    ref_type: tag

jobs:
  release:
    name: Release gem
    uses: theforeman/actions/.github/workflows/release-gem.yml@v0
    with:
      allowed_owner: MY_USERNAME
    secrets:
      api_key: ${{ secrets.RUBYGEM_API_KEY }}

actions's People

Contributors

dependabot[bot] avatar ekohl avatar evgeni 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.