Skip to content

Commit

Permalink
Merge pull request #48 from lewagon/feature/extend-compatibility-by-u…
Browse files Browse the repository at this point in the history
…sing-composite

Feature/extend compatibility by using composite
  • Loading branch information
matiasalbarello authored Sep 11, 2021
2 parents 5e93735 + 62e8671 commit 7e01e45
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 33 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2

- uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Install dependencies
run: bundle install
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/wait-using-mac-hosted-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Wait using Mac
on:
push:
workflow_dispatch:

jobs:
wait-on-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Wait on tests
uses: ./
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10 # seconds
running-workflow-name: wait-on-mac
check-name: wait-on-me

- name: Success
run: echo 'Success!'
21 changes: 21 additions & 0 deletions .github/workflows/wait-using-windows-hosted-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Wait using Windows
on:
push:
workflow_dispatch:

jobs:
wait-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Wait on tests
uses: ./
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10 # seconds
running-workflow-name: wait-on-windows
check-name: wait-on-me

- name: Success
run: echo 'Success!'
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ GEM
zeitwerk (2.4.2)

PLATFORMS
x64-mingw32
x86_64-darwin-19
x86_64-linux

Expand Down
29 changes: 18 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,24 @@ 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
with:
ruby-version: 2.7 # Not needed with a .ruby-version file
- run: bundle install
shell: bash
- run: ruby entrypoint.rb
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

0 comments on commit 7e01e45

Please sign in to comment.