Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.1.1.rc #51

Merged
merged 15 commits into from
Sep 18, 2021
16 changes: 12 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1.81.0
with:
ruby-version: 2.7 # Not needed with a .ruby-version file

- uses: actions/setup-ruby@v1
- name: Cache Ruby Gems
uses: actions/cache@v2
with:
ruby-version: '2.7'
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-

- name: Install dependencies
run: bundle install
- name: Bundle Install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: Run tests
run: cd app && bundle exec rspec
43 changes: 32 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,38 @@ inputs:
default: true

runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.allowed-conclusions }}
- ${{ inputs.check-name }}
- ${{ inputs.check-regexp }}
- ${{ inputs.ref }}
- ${{ inputs.repo-token }}
- ${{ inputs.verbose }}
- ${{ inputs.wait-interval }}
- ${{ inputs.running-workflow-name }}
using: "composite"
steps:
- uses: ruby/setup-ruby@v1.81.0
with:
ruby-version: 2.7 # Not needed with a .ruby-version file

- name: Cache Ruby Gems
uses: actions/cache@v2
with:
path: ${{ github.action_path }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-

- name: Bundle Install
run: |
bundle install --jobs 4 --retry 3
working-directory: ${{ github.action_path }}
shell: bash

- run: |
ruby entrypoint.rb
working-directory: ${{ github.action_path }}
shell: bash
env:
ALLOWED_CONCLUSIONS: ${{ inputs.allowed-conclusions }}
CHECK_NAME: ${{ inputs.check-name }}
CHECK_REGEXP: ${{ inputs.check-regexp }}
REF: ${{ inputs.ref }}
REPO_TOKEN: ${{ inputs.repo-token }}
VERBOSE: ${{ inputs.verbose }}
WAIT_INTERVAL: ${{ inputs.wait-interval }}
RUNNING_WORKFLOW_NAME: ${{ inputs.running-workflow-name }}
branding:
icon: "check-circle"
color: "green"
9 changes: 8 additions & 1 deletion entrypoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
require_relative "./app/services/github_checks_verifier"
require "octokit"

allowed_conclusions, check_name, check_regexp, ref, token, verbose, wait, workflow_name = ARGV
allowed_conclusions = ENV["ALLOWED_CONCLUSIONS"]
check_name = ENV["CHECK_NAME"]
check_regexp = ENV["CHECK_REGEXP"]
ref = ENV["REF"]
token = ENV["REPO_TOKEN"]
verbose = ENV["VERBOSE"]
wait = ENV["WAIT_INTERVAL"]
workflow_name = ENV["RUNNING_WORKFLOW_NAME"]

GithubChecksVerifier.configure do |config|
config.allowed_conclusions = allowed_conclusions.split(",").map(&:strip)
Expand Down