Skip to content

Commit

Permalink
Add additional setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwi committed Sep 18, 2024
1 parent 962cd72 commit 7bd3414
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .github/actions/test-ruby/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ inputs:
required: false
description: Reviewdog report
default: 'false'
ADDITIONAL_SETUP:
type: string
default: '[]'
description: 'JSON array of additional setup commands'

runs:
using: "composite"
Expand All @@ -44,6 +48,21 @@ runs:
bundler-cache: true
ruby-version: ${{ inputs.RUBY_VERSION }}

- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ inputs.RUBY_VERSION }}

- name: Additional Setup
if: inputs.ADDITIONAL_SETUP != '[]'
run: |
additional_setup='${{ inputs.ADDITIONAL_SETUP }}'
echo "$additional_setup" | jq -r '.[]' | while read -r command; do
echo "Executing additional setup command: $command"
eval "$command"
done
- uses: actions/cache@v4
with:
path: vendor/bundle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
ref: ryanwi/additional-setup
path: actions

- uses: ./actions/.github/actions/gpg
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ on:
RUBY_RAKE_COMMANDS:
type: string
description: A comma-separated list of rake commands.
ADDITIONAL_SETUP:
type: string
default: '[]'
description: 'JSON array of additional setup commands'
ZEITWERK:
type: boolean
description: Zeitwerk run.
Expand Down Expand Up @@ -152,7 +156,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
ref: ryanwi/additional-setup
path: actions

- name: Retrieve Secrets from HashiCorp Vault
Expand Down Expand Up @@ -199,6 +203,7 @@ jobs:
RUBY_VERSION: ${{ inputs.RUBY_VERSION }}
ENV_PATH: ${{ inputs.ENV_PATH }}
RUBY_RAKE_COMMANDS: ${{ inputs.RUBY_RAKE_COMMANDS }}
ADDITIONAL_SETUP: ${{ inputs.ADDITIONAL_SETUP }}
ZEITWERK: ${{ inputs.ZEITWERK }}
BRAKEMAN: ${{ inputs.BRAKEMAN }}
RUBOCOP: ${{ inputs.RUBOCOP }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ on:
RUBY_RAKE_COMMANDS:
type: string
description: A comma-separated list of rake commands.
ADDITIONAL_SETUP:
type: string
default: '[]'
description: 'JSON array of additional setup commands'
ZEITWERK:
type: boolean
description: Zeitwerk run.
Expand Down Expand Up @@ -212,7 +216,7 @@ jobs:

CHECK:
name: CI
uses: signalwire/actions-template/.github/workflows/ci-check.yml@main
uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/additional-setup
with:
ENVIRONMENT: ${{ inputs.ENVIRONMENT }}
PROJECT_NAME: ${{ inputs.PROJECT_NAME }}
Expand All @@ -229,6 +233,7 @@ jobs:
ENV_PATH: ${{ inputs.ENV_PATH }}
TEST_CREATE_NETWORK: ${{ inputs.TEST_CREATE_NETWORK }}
RUBY_RAKE_COMMANDS: ${{ inputs.RUBY_RAKE_COMMANDS }}
ADDITIONAL_SETUP: ${{ inputs.ADDITIONAL_SETUP }}
ZEITWERK: ${{ inputs.ZEITWERK }}
BRAKEMAN: ${{ inputs.BRAKEMAN }}
RUBOCOP: ${{ inputs.RUBOCOP }}
Expand All @@ -250,7 +255,7 @@ jobs:
BUILD:
name: BUILD
needs: CHECK
uses: signalwire/actions-template/.github/workflows/ci-build.yml@main
uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/additional-setup
with:
ENVIRONMENT: ${{ inputs.ENVIRONMENT }}
PROJECT_NAME: ${{ inputs.PROJECT_NAME }}
Expand Down

0 comments on commit 7bd3414

Please sign in to comment.