Skip to content

Commit 7e01e45

Browse files
Merge pull request #48 from lewagon/feature/extend-compatibility-by-using-composite
Feature/extend compatibility by using composite
2 parents 5e93735 + 62e8671 commit 7e01e45

File tree

7 files changed

+73
-33
lines changed

7 files changed

+73
-33
lines changed

.github/workflows/run-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19-
20-
- uses: actions/setup-ruby@v1
21-
with:
22-
ruby-version: '2.7'
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: 2.7
22+
bundler-cache: true
2323

2424
- name: Install dependencies
2525
run: bundle install
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Wait using Mac
2+
on:
3+
push:
4+
workflow_dispatch:
5+
6+
jobs:
7+
wait-on-mac:
8+
runs-on: macos-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Wait on tests
12+
uses: ./
13+
with:
14+
ref: ${{ github.sha }}
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}
16+
wait-interval: 10 # seconds
17+
running-workflow-name: wait-on-mac
18+
check-name: wait-on-me
19+
20+
- name: Success
21+
run: echo 'Success!'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Wait using Windows
2+
on:
3+
push:
4+
workflow_dispatch:
5+
6+
jobs:
7+
wait-on-windows:
8+
runs-on: windows-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Wait on tests
12+
uses: ./
13+
with:
14+
ref: ${{ github.sha }}
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}
16+
wait-interval: 10 # seconds
17+
running-workflow-name: wait-on-windows
18+
check-name: wait-on-me
19+
20+
- name: Success
21+
run: echo 'Success!'

Dockerfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ GEM
7373
zeitwerk (2.4.2)
7474

7575
PLATFORMS
76+
x64-mingw32
7677
x86_64-darwin-19
7778
x86_64-linux
7879

action.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,24 @@ inputs:
3636
default: true
3737

3838
runs:
39-
using: "docker"
40-
image: "Dockerfile"
41-
args:
42-
- ${{ inputs.allowed-conclusions }}
43-
- ${{ inputs.check-name }}
44-
- ${{ inputs.check-regexp }}
45-
- ${{ inputs.ref }}
46-
- ${{ inputs.repo-token }}
47-
- ${{ inputs.verbose }}
48-
- ${{ inputs.wait-interval }}
49-
- ${{ inputs.running-workflow-name }}
39+
using: "composite"
40+
steps:
41+
- uses: ruby/setup-ruby@v1
42+
with:
43+
ruby-version: 2.7 # Not needed with a .ruby-version file
44+
- run: bundle install
45+
shell: bash
46+
- run: ruby entrypoint.rb
47+
shell: bash
48+
env:
49+
ALLOWED_CONCLUSIONS: ${{ inputs.allowed-conclusions }}
50+
CHECK_NAME: ${{ inputs.check-name }}
51+
CHECK_REGEXP: ${{ inputs.check-regexp }}
52+
REF: ${{ inputs.ref }}
53+
REPO_TOKEN: ${{ inputs.repo-token }}
54+
VERBOSE: ${{ inputs.verbose }}
55+
WAIT_INTERVAL: ${{ inputs.wait-interval }}
56+
RUNNING_WORKFLOW_NAME: ${{ inputs.running-workflow-name }}
5057
branding:
5158
icon: "check-circle"
5259
color: "green"

entrypoint.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
require_relative "./app/services/github_checks_verifier"
33
require "octokit"
44

5-
allowed_conclusions, check_name, check_regexp, ref, token, verbose, wait, workflow_name = ARGV
5+
allowed_conclusions = ENV["ALLOWED_CONCLUSIONS"]
6+
check_name = ENV["CHECK_NAME"]
7+
check_regexp = ENV["CHECK_REGEXP"]
8+
ref = ENV["REF"]
9+
token = ENV["REPO_TOKEN"]
10+
verbose = ENV["VERBOSE"]
11+
wait = ENV["WAIT_INTERVAL"]
12+
workflow_name = ENV["RUNNING_WORKFLOW_NAME"]
613

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

0 commit comments

Comments
 (0)