From 7f65c0d8086dd0a4f4caf0c2311ef0770c93ac93 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Sun, 12 Sep 2021 21:55:28 +0200 Subject: [PATCH 01/15] Try using github.action_path to run script --- action.yml | 29 ++++++++++++++++++----------- entrypoint.rb | 9 ++++++++- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index 28c592a..73d9d65 100644 --- a/action.yml +++ b/action.yml @@ -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 ${{ github.action_path }}/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" diff --git a/entrypoint.rb b/entrypoint.rb index 080a5e8..f46855f 100755 --- a/entrypoint.rb +++ b/entrypoint.rb @@ -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) From aea71d39439949351a8ba8aa743a8d4c4a20d9b7 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Sun, 12 Sep 2021 22:01:07 +0200 Subject: [PATCH 02/15] Update action.yml --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 73d9d65..e9f8631 100644 --- a/action.yml +++ b/action.yml @@ -38,9 +38,10 @@ inputs: runs: using: "composite" steps: - - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@v1.81.0 with: ruby-version: 2.7 # Not needed with a .ruby-version file + bundler-cache: true - run: bundle install shell: bash - run: ruby ${{ github.action_path }}/entrypoint.rb From 06168d20c7409911e6479c98d3d7acac715ce245 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Sun, 12 Sep 2021 22:04:16 +0200 Subject: [PATCH 03/15] Update action.yml --- action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/action.yml b/action.yml index e9f8631..f96e7e3 100644 --- a/action.yml +++ b/action.yml @@ -42,8 +42,6 @@ runs: with: ruby-version: 2.7 # Not needed with a .ruby-version file bundler-cache: true - - run: bundle install - shell: bash - run: ruby ${{ github.action_path }}/entrypoint.rb shell: bash env: From 7dc902282f3a55ebcd2e2cb9abe26d4c26105851 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Sun, 12 Sep 2021 22:10:22 +0200 Subject: [PATCH 04/15] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index f96e7e3..bb6549e 100644 --- a/action.yml +++ b/action.yml @@ -42,6 +42,7 @@ runs: with: ruby-version: 2.7 # Not needed with a .ruby-version file bundler-cache: true + working-directory: ./lewagon_wait-on-check-action - run: ruby ${{ github.action_path }}/entrypoint.rb shell: bash env: From af33227351a522e34ac8d6affed01e203cea005f Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Sun, 12 Sep 2021 22:17:57 +0200 Subject: [PATCH 05/15] Update action.yml --- action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index bb6549e..e3ad2fe 100644 --- a/action.yml +++ b/action.yml @@ -41,9 +41,10 @@ runs: - uses: ruby/setup-ruby@v1.81.0 with: ruby-version: 2.7 # Not needed with a .ruby-version file - bundler-cache: true - working-directory: ./lewagon_wait-on-check-action - - run: ruby ${{ github.action_path }}/entrypoint.rb + - run: | + cd ${{ github.action_path }} + bundle install + ruby entrypoint.rb shell: bash env: ALLOWED_CONCLUSIONS: ${{ inputs.allowed-conclusions }} From 542e0d6dfdfbf648fa8d21fc2a16888a6b92a2d6 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 21:52:34 +0200 Subject: [PATCH 06/15] Update action.yml --- action.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index e3ad2fe..550b169 100644 --- a/action.yml +++ b/action.yml @@ -41,10 +41,20 @@ runs: - uses: ruby/setup-ruby@v1.81.0 with: ruby-version: 2.7 # Not needed with a .ruby-version file - - run: | - cd ${{ github.action_path }} - bundle install - ruby entrypoint.rb + - name: Cache Ruby Gems + uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + - name: Bundle Install + run: | + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + + - run: ruby entrypoint.rb shell: bash env: ALLOWED_CONCLUSIONS: ${{ inputs.allowed-conclusions }} From bbf7029ff47b1f41b7db130338d3f9ed706a3f41 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 21:53:45 +0200 Subject: [PATCH 07/15] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 550b169..f816f6d 100644 --- a/action.yml +++ b/action.yml @@ -53,6 +53,7 @@ runs: run: | bundle config path vendor/bundle bundle install --jobs 4 --retry 3 + shell: bash - run: ruby entrypoint.rb shell: bash From 9ed30bfeae9dd0c51bac71bd3239882c268bbc65 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 21:57:42 +0200 Subject: [PATCH 08/15] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index f816f6d..7a6055d 100644 --- a/action.yml +++ b/action.yml @@ -44,14 +44,14 @@ runs: - name: Cache Ruby Gems uses: actions/cache@v2 with: - path: vendor/bundle + path: ${{ github.action_path }} key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - name: Bundle Install run: | - bundle config path vendor/bundle + bundle config path ${{ github.action_path }} bundle install --jobs 4 --retry 3 shell: bash From 2b0bc00f4d36fc9f7f5d7d6cb0f8c12e51d34426 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:02:06 +0200 Subject: [PATCH 09/15] Update action.yml --- action.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index 7a6055d..c7500bd 100644 --- a/action.yml +++ b/action.yml @@ -41,21 +41,15 @@ runs: - 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 config path ${{ github.action_path }} bundle install --jobs 4 --retry 3 - shell: bash + working-directory: ${{ github.action_path }} - - run: ruby entrypoint.rb + - run: | + ruby entrypoint.rb + working-directory: ${{ github.action_path }} shell: bash env: ALLOWED_CONCLUSIONS: ${{ inputs.allowed-conclusions }} From 024d9760c52bcfb92d3e90d42082d0d8b2819b05 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:03:02 +0200 Subject: [PATCH 10/15] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index c7500bd..f70971c 100644 --- a/action.yml +++ b/action.yml @@ -46,6 +46,7 @@ runs: run: | bundle install --jobs 4 --retry 3 working-directory: ${{ github.action_path }} + shell: bash - run: | ruby entrypoint.rb From 62130118ba3c05e1f6e257b05042a3c5f18ff830 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:06:55 +0200 Subject: [PATCH 11/15] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index f70971c..edee097 100644 --- a/action.yml +++ b/action.yml @@ -45,12 +45,12 @@ runs: - name: Bundle Install run: | bundle install --jobs 4 --retry 3 - working-directory: ${{ github.action_path }} + working-directory: ${{ github.action_path }} shell: bash - run: | ruby entrypoint.rb - working-directory: ${{ github.action_path }} + working-directory: ${{ github.action_path }} shell: bash env: ALLOWED_CONCLUSIONS: ${{ inputs.allowed-conclusions }} From 550ecc3f0ada5a0e21d010f73d6d3c2354a958c7 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:10:55 +0200 Subject: [PATCH 12/15] Update action.yml --- action.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index edee097..4116855 100644 --- a/action.yml +++ b/action.yml @@ -41,12 +41,13 @@ runs: - uses: ruby/setup-ruby@v1.81.0 with: ruby-version: 2.7 # Not needed with a .ruby-version file + bundler-cache: true - - name: Bundle Install - run: | - bundle install --jobs 4 --retry 3 - working-directory: ${{ github.action_path }} - shell: bash + # - name: Bundle Install + # run: | + # bundle install --jobs 4 --retry 3 + # working-directory: ${{ github.action_path }} + # shell: bash - run: | ruby entrypoint.rb From 315a64d9b7fd4d626bb4c1cdd4984351db862b97 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:18:17 +0200 Subject: [PATCH 13/15] Update run-tests.yml --- .github/workflows/run-tests.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8340405..50314c7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 From 5c0346658e339a02e4c7414ea5d3b6e51e6e9afc Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:18:20 +0200 Subject: [PATCH 14/15] Update action.yml --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 4116855..ecbc28d 100644 --- a/action.yml +++ b/action.yml @@ -42,6 +42,7 @@ runs: with: ruby-version: 2.7 # Not needed with a .ruby-version file bundler-cache: true + working-directory: ${{ github.action_path }} # - name: Bundle Install # run: | From 34ca0d899d15da64e3f2a8ed397bfcef6cd0ba83 Mon Sep 17 00:00:00 2001 From: Matias Albarello Date: Thu, 16 Sep 2021 22:21:33 +0200 Subject: [PATCH 15/15] Update action.yml --- action.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index ecbc28d..b5333e2 100644 --- a/action.yml +++ b/action.yml @@ -41,14 +41,19 @@ runs: - uses: ruby/setup-ruby@v1.81.0 with: ruby-version: 2.7 # Not needed with a .ruby-version file - bundler-cache: true - working-directory: ${{ github.action_path }} - # - name: Bundle Install - # run: | - # bundle install --jobs 4 --retry 3 - # working-directory: ${{ github.action_path }} - # shell: bash + - 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