From 7bd3414e90b00fd7ec88808af2b0b7f9906b1f2c Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 18:00:07 -0700 Subject: [PATCH 01/43] Add additional setup --- .github/actions/test-ruby/action.yml | 19 +++++++++++++++++++ .github/workflows/ci-build.yml | 2 +- .github/workflows/ci-check.yml | 7 ++++++- .github/workflows/ci.yml | 9 +++++++-- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index a63e9508..8ab0ed01 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -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" @@ -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 diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 703db0ae..7731d006 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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 diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index ad7c6039..b85c956d 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -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. @@ -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 @@ -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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51c0c74f..d6a37a96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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. @@ -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 }} @@ -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 }} @@ -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 }} From 63af4baeb9f33d4a4d74051674b9612681408de3 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 18:04:39 -0700 Subject: [PATCH 02/43] add shell --- .github/actions/test-ruby/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 8ab0ed01..d162e1cf 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -56,6 +56,7 @@ runs: - name: Additional Setup if: inputs.ADDITIONAL_SETUP != '[]' + shell: bash run: | additional_setup='${{ inputs.ADDITIONAL_SETUP }}' echo "$additional_setup" | jq -r '.[]' | while read -r command; do From 7cd5d8835e05cf535f096014460895b4899d9227 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 20:38:12 -0700 Subject: [PATCH 03/43] use gha setup python --- .github/actions/test-ruby/action.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index d162e1cf..ab1ff405 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -54,15 +54,19 @@ runs: bundler-cache: true ruby-version: ${{ inputs.RUBY_VERSION }} - - name: Additional Setup - if: inputs.ADDITIONAL_SETUP != '[]' - shell: bash - 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/setup-python@v5 + with: + python-version: '3.9.2' + + # - name: Additional Setup + # if: inputs.ADDITIONAL_SETUP != '[]' + # shell: bash + # 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: From 01cdd37cfaf92d352baf17ade4a25cd976110d7b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 20:39:55 -0700 Subject: [PATCH 04/43] use gha setup python --- .github/actions/test-ruby/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index ab1ff405..bfe589ae 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -48,12 +48,6 @@ 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 }} - - uses: actions/setup-python@v5 with: python-version: '3.9.2' From aae30467221ced15d14f89dc7b5384b8cf52cad5 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 20:42:59 -0700 Subject: [PATCH 05/43] use gha setup python --- .github/actions/test-ruby/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index bfe589ae..c21c3925 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -50,7 +50,7 @@ runs: - uses: actions/setup-python@v5 with: - python-version: '3.9.2' + python-version: '3.9' # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 577a48422356c09b15c9610b8a8cee85bdf5755b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 20:46:54 -0700 Subject: [PATCH 06/43] use gha setup python --- .github/actions/test-ruby/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index c21c3925..ce51ab88 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -49,8 +49,6 @@ runs: ruby-version: ${{ inputs.RUBY_VERSION }} - uses: actions/setup-python@v5 - with: - python-version: '3.9' # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 4df58af82bd13a375962922a1f95922659bf29ae Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 20:54:11 -0700 Subject: [PATCH 07/43] use gha setup python --- .github/actions/test-ruby/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index ce51ab88..6b796b43 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -49,6 +49,9 @@ runs: ruby-version: ${{ inputs.RUBY_VERSION }} - uses: actions/setup-python@v5 + # with: + # cache: 'pip' # caching pip dependencies + # - run: pip install -r requirements.txt # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 12657d51319ddc33bc3f8126b170320e9f96a1e5 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:21:30 -0700 Subject: [PATCH 08/43] install --- .github/actions/test-ruby/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 6b796b43..334bb0c9 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -49,9 +49,9 @@ runs: ruby-version: ${{ inputs.RUBY_VERSION }} - uses: actions/setup-python@v5 - # with: - # cache: 'pip' # caching pip dependencies - # - run: pip install -r requirements.txt + with: + cache: 'pip' + - run: pip install -r requirements.txt # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 4c5c812be134c4980ab75824d38421fa8960b20b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:22:44 -0700 Subject: [PATCH 09/43] install --- .github/actions/test-ruby/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 334bb0c9..eab072d2 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -52,6 +52,7 @@ runs: with: cache: 'pip' - run: pip install -r requirements.txt + shell: bash # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 2ce57c0d521bee0878e8ed82d2e3a0125d10d2da Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:23:36 -0700 Subject: [PATCH 10/43] install --- .github/actions/test-ruby/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index eab072d2..d7295269 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -51,6 +51,8 @@ runs: - uses: actions/setup-python@v5 with: cache: 'pip' + - run: pip -V + shell: bash - run: pip install -r requirements.txt shell: bash From 8c6a6bdc4aeea82286d28d08d545f9d0dc5f7be8 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:37:14 -0700 Subject: [PATCH 11/43] install --- .github/actions/test-ruby/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index d7295269..a1010aab 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -147,7 +147,7 @@ runs: - name: Run Tests run: | - bundle exec rspec -f j -o tmp/rspec_results.json -f p + bundle exec rspec -f j -o tmp/rspec_results.json -f p spec/services/data_sphere/extractor_spec.rb shell: bash - name: RSpec Report From d9ce4214aea5640799f2162977df1c58b08cba18 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:42:08 -0700 Subject: [PATCH 12/43] faster debug --- .github/actions/test-ruby/action.yml | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index a1010aab..043cc21e 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -89,17 +89,17 @@ runs: fi shell: bash - - name: Run zeitwerk chek - if: inputs.ZEITWERK == 'true' - run: | - bin/rails zeitwerk:check - shell: bash + # - name: Run zeitwerk chek + # if: inputs.ZEITWERK == 'true' + # run: | + # bin/rails zeitwerk:check + # shell: bash - - name: Generate Brakeman report - if: inputs.BRAKEMAN == 'true' - run: | - bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 - shell: bash + # - name: Generate Brakeman report + # if: inputs.BRAKEMAN == 'true' + # run: | + # bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 + # shell: bash # - name: Publish report # if: inputs.BRAKEMAN == 'true' @@ -108,29 +108,29 @@ runs: # GITHUB_TOKEN: ${{github.token}} # REPORT_PATH: tmp/brakeman.json - - name: Install Reviewdog - if: inputs.RUBOCOP == 'true' - uses: reviewdog/action-setup@v1 - - - name: Generate RuboCop report - if: inputs.RUBOCOP == 'true' - uses: d-lebed/rubocop-run-action@v0.11.0 - with: - options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress - rdjson_formatter: ${{ inputs.REVIEWDOG }} - preserve_exitcode: false - - - name: Post Review - if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} - run: | - reviewdog \ - -reporter=github-pr-review \ - -filter-mode=added \ - -f=rdjson \ - < reviewdog-report.json - shell: bash + # - name: Install Reviewdog + # if: inputs.RUBOCOP == 'true' + # uses: reviewdog/action-setup@v1 + + # - name: Generate RuboCop report + # if: inputs.RUBOCOP == 'true' + # uses: d-lebed/rubocop-run-action@v0.11.0 + # with: + # options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress + # rdjson_formatter: ${{ inputs.REVIEWDOG }} + # preserve_exitcode: false + + # - name: Post Review + # if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' + # env: + # REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} + # run: | + # reviewdog \ + # -reporter=github-pr-review \ + # -filter-mode=added \ + # -f=rdjson \ + # < reviewdog-report.json + # shell: bash - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute if: inputs.RUBY_RAKE_COMMANDS != null From 63f359aad70873e8d65d48328d1d6785acce3efc Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:50:21 -0700 Subject: [PATCH 13/43] install --- .github/actions/test-ruby/action.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 043cc21e..44e1d7cb 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -53,8 +53,20 @@ runs: cache: 'pip' - run: pip -V shell: bash - - run: pip install -r requirements.txt + - run: | + python -m pip install --upgrade pip + pip install -r requirements.txt shell: bash + - run: pip -V + shell: bash + + - name: Download NLTK data + run: | + python -m nltk.downloader -d /usr/local/share/nltk_data punkt punkt_tab + + - name: Verify NLTK data installation + run: | + python -c "import nltk; nltk.data.path.append('/usr/local/share/nltk_data'); nltk.tokenize.word_tokenize('This is a test.')" # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 66fdf968b510d114e8a5598d323f896f15ee034a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:52:17 -0700 Subject: [PATCH 14/43] cache working --- .github/actions/test-ruby/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 44e1d7cb..4ff2fffd 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -51,6 +51,7 @@ runs: - uses: actions/setup-python@v5 with: cache: 'pip' + cache-dependency-path: 'requirements.txt' - run: pip -V shell: bash - run: | From bc1e37d92878439ec3cf77e5193414cfd48f6c44 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:54:08 -0700 Subject: [PATCH 15/43] faster debug --- .github/actions/test-ruby/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 4ff2fffd..2d5ae541 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -54,20 +54,24 @@ runs: cache-dependency-path: 'requirements.txt' - run: pip -V shell: bash + - run: | python -m pip install --upgrade pip pip install -r requirements.txt shell: bash + - run: pip -V shell: bash - name: Download NLTK data run: | python -m nltk.downloader -d /usr/local/share/nltk_data punkt punkt_tab + shell: bash - name: Verify NLTK data installation run: | python -c "import nltk; nltk.data.path.append('/usr/local/share/nltk_data'); nltk.tokenize.word_tokenize('This is a test.')" + shell: bash # - name: Additional Setup # if: inputs.ADDITIONAL_SETUP != '[]' From 293b81699cb8bc4d2afaf63418f49d3ba4a87588 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:57:27 -0700 Subject: [PATCH 16/43] faster debug --- .github/actions/test-ruby/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 2d5ae541..aaf2a52a 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -65,12 +65,12 @@ runs: - name: Download NLTK data run: | - python -m nltk.downloader -d /usr/local/share/nltk_data punkt punkt_tab + python -m nltk.downloader -d $HOME/nltk_data punkt punkt_tab shell: bash - name: Verify NLTK data installation run: | - python -c "import nltk; nltk.data.path.append('/usr/local/share/nltk_data'); nltk.tokenize.word_tokenize('This is a test.')" + python -c "import nltk; nltk.data.path.append('$HOME/nltk_data'); nltk.tokenize.word_tokenize('This is a test.')" shell: bash # - name: Additional Setup From 10f193b9e2d35ddc56f3c9c10d1b1a5e567b0b2b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 22:58:32 -0700 Subject: [PATCH 17/43] faster debug --- .github/actions/test-ruby/action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index aaf2a52a..f1fd51b2 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -52,17 +52,12 @@ runs: with: cache: 'pip' cache-dependency-path: 'requirements.txt' - - run: pip -V - shell: bash - run: | python -m pip install --upgrade pip pip install -r requirements.txt shell: bash - - run: pip -V - shell: bash - - name: Download NLTK data run: | python -m nltk.downloader -d $HOME/nltk_data punkt punkt_tab From 6a6dc60b44640a5126ef8a5fe12882c44ee2b11a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 23:02:03 -0700 Subject: [PATCH 18/43] faster debug --- .github/actions/test-ruby/action.yml | 45 +++++++++++++--------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index f1fd51b2..577267ac 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -48,35 +48,30 @@ runs: bundler-cache: true ruby-version: ${{ inputs.RUBY_VERSION }} - - uses: actions/setup-python@v5 - with: - cache: 'pip' - cache-dependency-path: 'requirements.txt' + # - uses: actions/setup-python@v5 + # with: + # cache: 'pip' + # cache-dependency-path: 'requirements.txt' - - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - shell: bash + # - run: | + # python -m pip install --upgrade pip + # pip install -r requirements.txt + # shell: bash - - name: Download NLTK data - run: | - python -m nltk.downloader -d $HOME/nltk_data punkt punkt_tab - shell: bash + # - name: Download NLTK data + # run: | + # python -m nltk.downloader -d $HOME/nltk_data punkt punkt_tab + # shell: bash - - name: Verify NLTK data installation - run: | - python -c "import nltk; nltk.data.path.append('$HOME/nltk_data'); nltk.tokenize.word_tokenize('This is a test.')" + - name: Additional Setup + if: inputs.ADDITIONAL_SETUP != '[]' shell: bash - - # - name: Additional Setup - # if: inputs.ADDITIONAL_SETUP != '[]' - # shell: bash - # 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 + 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: From 937d34a10991c2e04b99f1be75bdc1cfe29f18fc Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 23:05:00 -0700 Subject: [PATCH 19/43] faster debug --- .github/actions/test-ruby/action.yml | 101 ++++++++++++--------------- 1 file changed, 43 insertions(+), 58 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 577267ac..a1667f3d 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -48,21 +48,6 @@ runs: bundler-cache: true ruby-version: ${{ inputs.RUBY_VERSION }} - # - uses: actions/setup-python@v5 - # with: - # cache: 'pip' - # cache-dependency-path: 'requirements.txt' - - # - run: | - # python -m pip install --upgrade pip - # pip install -r requirements.txt - # shell: bash - - # - name: Download NLTK data - # run: | - # python -m nltk.downloader -d $HOME/nltk_data punkt punkt_tab - # shell: bash - - name: Additional Setup if: inputs.ADDITIONAL_SETUP != '[]' shell: bash @@ -96,48 +81,48 @@ runs: fi shell: bash - # - name: Run zeitwerk chek - # if: inputs.ZEITWERK == 'true' - # run: | - # bin/rails zeitwerk:check - # shell: bash - - # - name: Generate Brakeman report - # if: inputs.BRAKEMAN == 'true' - # run: | - # bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 - # shell: bash - -# - name: Publish report -# if: inputs.BRAKEMAN == 'true' -# uses: devmasx/brakeman-linter-action@v1.0.0 -# env: -# GITHUB_TOKEN: ${{github.token}} -# REPORT_PATH: tmp/brakeman.json - - # - name: Install Reviewdog - # if: inputs.RUBOCOP == 'true' - # uses: reviewdog/action-setup@v1 - - # - name: Generate RuboCop report - # if: inputs.RUBOCOP == 'true' - # uses: d-lebed/rubocop-run-action@v0.11.0 - # with: - # options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress - # rdjson_formatter: ${{ inputs.REVIEWDOG }} - # preserve_exitcode: false - - # - name: Post Review - # if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' - # env: - # REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} - # run: | - # reviewdog \ - # -reporter=github-pr-review \ - # -filter-mode=added \ - # -f=rdjson \ - # < reviewdog-report.json - # shell: bash + - name: Run zeitwerk chek + if: inputs.ZEITWERK == 'true' + run: | + bin/rails zeitwerk:check + shell: bash + + - name: Generate Brakeman report + if: inputs.BRAKEMAN == 'true' + run: | + bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 + shell: bash + + - name: Publish report + if: inputs.BRAKEMAN == 'true' + uses: devmasx/brakeman-linter-action@v1.0.0 + env: + GITHUB_TOKEN: ${{github.token}} + REPORT_PATH: tmp/brakeman.json + + - name: Install Reviewdog + if: inputs.RUBOCOP == 'true' + uses: reviewdog/action-setup@v1 + + - name: Generate RuboCop report + if: inputs.RUBOCOP == 'true' + uses: d-lebed/rubocop-run-action@v0.11.0 + with: + options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress + rdjson_formatter: ${{ inputs.REVIEWDOG }} + preserve_exitcode: false + + - name: Post Review + if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} + run: | + reviewdog \ + -reporter=github-pr-review \ + -filter-mode=added \ + -f=rdjson \ + < reviewdog-report.json + shell: bash - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute if: inputs.RUBY_RAKE_COMMANDS != null @@ -154,7 +139,7 @@ runs: - name: Run Tests run: | - bundle exec rspec -f j -o tmp/rspec_results.json -f p spec/services/data_sphere/extractor_spec.rb + bundle exec rspec -f j -o tmp/rspec_results.json -f p shell: bash - name: RSpec Report From cd32dd230b3f239ff6c1f66f798c219134676cb7 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 23:05:23 -0700 Subject: [PATCH 20/43] faster debug --- .github/actions/test-ruby/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index a1667f3d..e5bd62d9 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -93,12 +93,12 @@ runs: bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 shell: bash - - name: Publish report - if: inputs.BRAKEMAN == 'true' - uses: devmasx/brakeman-linter-action@v1.0.0 - env: - GITHUB_TOKEN: ${{github.token}} - REPORT_PATH: tmp/brakeman.json + # - name: Publish report + # if: inputs.BRAKEMAN == 'true' + # uses: devmasx/brakeman-linter-action@v1.0.0 + # env: + # GITHUB_TOKEN: ${{github.token}} + # REPORT_PATH: tmp/brakeman.json - name: Install Reviewdog if: inputs.RUBOCOP == 'true' From 5d2ff4bb3b70e678eb614a11eea3f9bce112b7ee Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 17 Sep 2024 23:05:57 -0700 Subject: [PATCH 21/43] faster debug --- .github/actions/test-ruby/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index e5bd62d9..8c7ba5ae 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -93,12 +93,12 @@ runs: bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 shell: bash - # - name: Publish report - # if: inputs.BRAKEMAN == 'true' - # uses: devmasx/brakeman-linter-action@v1.0.0 - # env: - # GITHUB_TOKEN: ${{github.token}} - # REPORT_PATH: tmp/brakeman.json +# - name: Publish report +# if: inputs.BRAKEMAN == 'true' +# uses: devmasx/brakeman-linter-action@v1.0.0 +# env: +# GITHUB_TOKEN: ${{github.token}} +# REPORT_PATH: tmp/brakeman.json - name: Install Reviewdog if: inputs.RUBOCOP == 'true' From b7b0e7ce0b2932eb104b283ea57ae3c688f67bda Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 08:17:51 -0700 Subject: [PATCH 22/43] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6a37a96..6a9896ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -255,7 +255,7 @@ jobs: BUILD: name: BUILD needs: CHECK - uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/additional-setup + uses: signalwire/actions-template/.github/workflows/ci-build.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From 4f560b8596c21beb2402d467e9a16ca83af6e98b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 08:18:07 -0700 Subject: [PATCH 23/43] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a9896ca..b4ff3e30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,7 +216,7 @@ jobs: CHECK: name: CI - uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/additional-setup + uses: signalwire/actions-template/.github/workflows/ci-check.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} From 0b654f18ff52be6b2a45d7e6bad280c77b110f4a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 08:18:23 -0700 Subject: [PATCH 24/43] Update .github/workflows/ci-check.yml --- .github/workflows/ci-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index b85c956d..eb15e93d 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -156,7 +156,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: ryanwi/additional-setup + ref: main path: actions - name: Retrieve Secrets from HashiCorp Vault From 1ac67ec3ab0b4eccfc4265d24a40ecf9593f9609 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 08:18:37 -0700 Subject: [PATCH 25/43] Update .github/workflows/ci-build.yml --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7731d006..703db0ae 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -224,7 +224,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: ryanwi/additional-setup + ref: main path: actions - uses: ./actions/.github/actions/gpg From 82694914526b46716cd1fc74c0423a48842d18f4 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 10:29:17 -0700 Subject: [PATCH 26/43] Revert "Update .github/workflows/ci-build.yml" This reverts commit 1ac67ec3ab0b4eccfc4265d24a40ecf9593f9609. --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 703db0ae..7731d006 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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 From a1435dc48b38257ccb6036d5609b1e7ec0291eab Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 10:29:25 -0700 Subject: [PATCH 27/43] Revert "Update .github/workflows/ci-check.yml" This reverts commit 0b654f18ff52be6b2a45d7e6bad280c77b110f4a. --- .github/workflows/ci-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index eb15e93d..b85c956d 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -156,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 From 3b64afa6d2c4e187ab640d8fa035fb011c707d47 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 10:29:33 -0700 Subject: [PATCH 28/43] Revert "Update .github/workflows/ci.yml" This reverts commit 4f560b8596c21beb2402d467e9a16ca83af6e98b. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ff3e30..6a9896ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,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 }} From 60292c4414d222bc73aad1ef3704c7a1f6d3a688 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 10:29:40 -0700 Subject: [PATCH 29/43] Revert "Update .github/workflows/ci.yml" This reverts commit b7b0e7ce0b2932eb104b283ea57ae3c688f67bda. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a9896ca..d6a37a96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -255,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 }} From aa3cfcfedaaa08805b5469778f04a8034173e9a9 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 13:12:02 -0700 Subject: [PATCH 30/43] use env var --- .github/actions/test-ruby/action.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 8c7ba5ae..5bd303e3 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -51,13 +51,29 @@ runs: - name: Additional Setup if: inputs.ADDITIONAL_SETUP != '[]' shell: bash + env: + ADDITIONAL_COMMANDS: ${{ inputs.ADDITIONAL_COMMANDS }} run: | - additional_setup='${{ inputs.ADDITIONAL_SETUP }}' - echo "$additional_setup" | jq -r '.[]' | while read -r command; do - echo "Executing additional setup command: $command" - eval "$command" + echo "$ADDITIONAL_COMMANDS" | jq -r '.[]' | while read -r command; do + echo "Executing command: $command" + $command done +- name: Execute additional commands + if: inputs.ADDITIONAL_COMMANDS != '[]' + shell: bash + env: + ADDITIONAL_COMMANDS: ${{ inputs.ADDITIONAL_COMMANDS }} + run: | + echo "$ADDITIONAL_COMMANDS" | jq -r '.[]' | while read -r command; do + echo "Executing command: $command" + if [[ $command == bundle* || $command == rake* ]]; then + $command + else + echo "Skipping unauthorized command: $command" + fi + done + - uses: actions/cache@v4 with: path: vendor/bundle From c80639e0c936c79b2ea70ce48b664af47782070b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 13:21:51 -0700 Subject: [PATCH 31/43] use env var --- .github/actions/test-ruby/action.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 5bd303e3..d0579d16 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -59,21 +59,6 @@ runs: $command done -- name: Execute additional commands - if: inputs.ADDITIONAL_COMMANDS != '[]' - shell: bash - env: - ADDITIONAL_COMMANDS: ${{ inputs.ADDITIONAL_COMMANDS }} - run: | - echo "$ADDITIONAL_COMMANDS" | jq -r '.[]' | while read -r command; do - echo "Executing command: $command" - if [[ $command == bundle* || $command == rake* ]]; then - $command - else - echo "Skipping unauthorized command: $command" - fi - done - - uses: actions/cache@v4 with: path: vendor/bundle From 17291aaa705fd5f4f6e1dae574a5931000cc1073 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 13:22:19 -0700 Subject: [PATCH 32/43] use env var --- .github/actions/test-ruby/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index d0579d16..398ab7db 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -52,9 +52,9 @@ runs: if: inputs.ADDITIONAL_SETUP != '[]' shell: bash env: - ADDITIONAL_COMMANDS: ${{ inputs.ADDITIONAL_COMMANDS }} + ADDITIONAL_SETUP: ${{ inputs.ADDITIONAL_SETUP }} run: | - echo "$ADDITIONAL_COMMANDS" | jq -r '.[]' | while read -r command; do + echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do echo "Executing command: $command" $command done From 856ae10e0a085926a36057118d7a9eb514c9cacf Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 15:56:31 -0700 Subject: [PATCH 33/43] more testing --- .github/actions/test-ruby/action.yml | 114 +++++++++++++-------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 398ab7db..d3d7f03a 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -73,26 +73,26 @@ runs: env: ENV_PATH: ${{ inputs.ENV_PATH }} - - name: Display env - run: | - if [[ -f .env ]]; then - cat .env - else - echo ".env file does not exist" - fi - shell: bash - - - name: Run zeitwerk chek - if: inputs.ZEITWERK == 'true' - run: | - bin/rails zeitwerk:check - shell: bash - - - name: Generate Brakeman report - if: inputs.BRAKEMAN == 'true' - run: | - bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 - shell: bash + # - name: Display env + # run: | + # if [[ -f .env ]]; then + # cat .env + # else + # echo ".env file does not exist" + # fi + # shell: bash + + # - name: Run zeitwerk chek + # if: inputs.ZEITWERK == 'true' + # run: | + # bin/rails zeitwerk:check + # shell: bash + + # - name: Generate Brakeman report + # if: inputs.BRAKEMAN == 'true' + # run: | + # bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 + # shell: bash # - name: Publish report # if: inputs.BRAKEMAN == 'true' @@ -101,46 +101,46 @@ runs: # GITHUB_TOKEN: ${{github.token}} # REPORT_PATH: tmp/brakeman.json - - name: Install Reviewdog - if: inputs.RUBOCOP == 'true' - uses: reviewdog/action-setup@v1 - - - name: Generate RuboCop report - if: inputs.RUBOCOP == 'true' - uses: d-lebed/rubocop-run-action@v0.11.0 - with: - options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress - rdjson_formatter: ${{ inputs.REVIEWDOG }} - preserve_exitcode: false - - - name: Post Review - if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} - run: | - reviewdog \ - -reporter=github-pr-review \ - -filter-mode=added \ - -f=rdjson \ - < reviewdog-report.json - shell: bash - - - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute - if: inputs.RUBY_RAKE_COMMANDS != null - env: - arr: ${{ inputs.RUBY_RAKE_COMMANDS }} - run: | - IFS=',' read -ra arr <<< "$arr" - for i in "${arr[@]}"; do - if [[ $i == bundle* ]]; then - $i - fi - done - shell: bash + # - name: Install Reviewdog + # if: inputs.RUBOCOP == 'true' + # uses: reviewdog/action-setup@v1 + + # - name: Generate RuboCop report + # if: inputs.RUBOCOP == 'true' + # uses: d-lebed/rubocop-run-action@v0.11.0 + # with: + # options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress + # rdjson_formatter: ${{ inputs.REVIEWDOG }} + # preserve_exitcode: false + + # - name: Post Review + # if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' + # env: + # REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} + # run: | + # reviewdog \ + # -reporter=github-pr-review \ + # -filter-mode=added \ + # -f=rdjson \ + # < reviewdog-report.json + # shell: bash + + # - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute + # if: inputs.RUBY_RAKE_COMMANDS != null + # env: + # arr: ${{ inputs.RUBY_RAKE_COMMANDS }} + # run: | + # IFS=',' read -ra arr <<< "$arr" + # for i in "${arr[@]}"; do + # if [[ $i == bundle* ]]; then + # $i + # fi + # done + # shell: bash - name: Run Tests run: | - bundle exec rspec -f j -o tmp/rspec_results.json -f p + bundle exec rspec -f j -o tmp/rspec_results.json -f p spec/services/data_sphere/extractor_spec.rb:14 shell: bash - name: RSpec Report From 38b6a45c2af965228ae19c69870e36eae84557f2 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 15:59:35 -0700 Subject: [PATCH 34/43] more testing --- .github/actions/test-ruby/action.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index d3d7f03a..3ac2d019 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -125,18 +125,18 @@ runs: # < reviewdog-report.json # shell: bash - # - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute - # if: inputs.RUBY_RAKE_COMMANDS != null - # env: - # arr: ${{ inputs.RUBY_RAKE_COMMANDS }} - # run: | - # IFS=',' read -ra arr <<< "$arr" - # for i in "${arr[@]}"; do - # if [[ $i == bundle* ]]; then - # $i - # fi - # done - # shell: bash + - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute + if: inputs.RUBY_RAKE_COMMANDS != null + env: + arr: ${{ inputs.RUBY_RAKE_COMMANDS }} + run: | + IFS=',' read -ra arr <<< "$arr" + for i in "${arr[@]}"; do + if [[ $i == bundle* ]]; then + $i + fi + done + shell: bash - name: Run Tests run: | From f5b0e62ce08d5ee80cc99887fb3c71147878f562 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 16:04:23 -0700 Subject: [PATCH 35/43] more testing --- .github/actions/test-ruby/action.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 3ac2d019..2985a703 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -51,13 +51,19 @@ runs: - name: Additional Setup if: inputs.ADDITIONAL_SETUP != '[]' shell: bash - env: - ADDITIONAL_SETUP: ${{ inputs.ADDITIONAL_SETUP }} + # env: + # ADDITIONAL_SETUP: ${{ inputs.ADDITIONAL_SETUP }} run: | - echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do - echo "Executing command: $command" - $command + additional_setup='${{ inputs.ADDITIONAL_SETUP }}' + echo "$additional_setup" | jq -r '.[]' | while read -r command; do + echo "Executing additional setup command: $command" + eval "$command done + # run: | + # echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do + # echo "Executing command: $command" + # $command + # done - uses: actions/cache@v4 with: From 72ada1764bdfbaf84afa84f7bff976a429e2c71a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 16:08:11 -0700 Subject: [PATCH 36/43] more testing --- .github/actions/test-ruby/action.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 2985a703..abef03e3 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -51,19 +51,30 @@ runs: - name: Additional Setup if: inputs.ADDITIONAL_SETUP != '[]' shell: bash - # env: - # ADDITIONAL_SETUP: ${{ 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 + eval "$command" done - # run: | - # echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do - # echo "Executing command: $command" - # $command - # done + + # - name: Additional Setup + # if: inputs.ADDITIONAL_SETUP != '[]' + # shell: bash + # # env: + # # ADDITIONAL_SETUP: ${{ 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 + + # # run: | + # # echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do + # # echo "Executing command: $command" + # # $command + # # done - uses: actions/cache@v4 with: From 35792932cb06a80ec273f0fba83495a02011a567 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 16:11:10 -0700 Subject: [PATCH 37/43] more testing --- .github/actions/test-ruby/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index abef03e3..dd405bde 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -51,9 +51,10 @@ runs: - name: Additional Setup if: inputs.ADDITIONAL_SETUP != '[]' shell: bash + env: + ADDITIONAL_SETUP: ${{ inputs.ADDITIONAL_SETUP }} run: | - additional_setup='${{ inputs.ADDITIONAL_SETUP }}' - echo "$additional_setup" | jq -r '.[]' | while read -r command; do + echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do echo "Executing additional setup command: $command" eval "$command" done From 6e7be075527d01a1ced2cf1dbb3d10c5e07ae413 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 16:13:40 -0700 Subject: [PATCH 38/43] no eval --- .github/actions/test-ruby/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index dd405bde..5a67f790 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -56,7 +56,7 @@ runs: run: | echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do echo "Executing additional setup command: $command" - eval "$command" + $command done # - name: Additional Setup From a8bd2e415a0387928ae0ee9231ce9b4af1f8f7e0 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 16:18:11 -0700 Subject: [PATCH 39/43] use eval --- .github/actions/test-ruby/action.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 5a67f790..395f594d 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -56,27 +56,9 @@ runs: run: | echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do echo "Executing additional setup command: $command" - $command + eval "$command" done - # - name: Additional Setup - # if: inputs.ADDITIONAL_SETUP != '[]' - # shell: bash - # # env: - # # ADDITIONAL_SETUP: ${{ 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 - - # # run: | - # # echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do - # # echo "Executing command: $command" - # # $command - # # done - - uses: actions/cache@v4 with: path: vendor/bundle From 7c288d211ce57b60722e7c688eea74b008884636 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 16:22:39 -0700 Subject: [PATCH 40/43] done testing --- .github/actions/test-ruby/action.yml | 86 ++++++++++++++-------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 395f594d..cf7ef179 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -73,26 +73,26 @@ runs: env: ENV_PATH: ${{ inputs.ENV_PATH }} - # - name: Display env - # run: | - # if [[ -f .env ]]; then - # cat .env - # else - # echo ".env file does not exist" - # fi - # shell: bash - - # - name: Run zeitwerk chek - # if: inputs.ZEITWERK == 'true' - # run: | - # bin/rails zeitwerk:check - # shell: bash - - # - name: Generate Brakeman report - # if: inputs.BRAKEMAN == 'true' - # run: | - # bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 - # shell: bash + - name: Display env + run: | + if [[ -f .env ]]; then + cat .env + else + echo ".env file does not exist" + fi + shell: bash + + - name: Run zeitwerk chek + if: inputs.ZEITWERK == 'true' + run: | + bin/rails zeitwerk:check + shell: bash + + - name: Generate Brakeman report + if: inputs.BRAKEMAN == 'true' + run: | + bundle exec brakeman --skip-files bundle/ -q -w2 -f json > tmp/brakeman.json || exit 0 + shell: bash # - name: Publish report # if: inputs.BRAKEMAN == 'true' @@ -101,29 +101,29 @@ runs: # GITHUB_TOKEN: ${{github.token}} # REPORT_PATH: tmp/brakeman.json - # - name: Install Reviewdog - # if: inputs.RUBOCOP == 'true' - # uses: reviewdog/action-setup@v1 - - # - name: Generate RuboCop report - # if: inputs.RUBOCOP == 'true' - # uses: d-lebed/rubocop-run-action@v0.11.0 - # with: - # options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress - # rdjson_formatter: ${{ inputs.REVIEWDOG }} - # preserve_exitcode: false - - # - name: Post Review - # if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' - # env: - # REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} - # run: | - # reviewdog \ - # -reporter=github-pr-review \ - # -filter-mode=added \ - # -f=rdjson \ - # < reviewdog-report.json - # shell: bash + - name: Install Reviewdog + if: inputs.RUBOCOP == 'true' + uses: reviewdog/action-setup@v1 + + - name: Generate RuboCop report + if: inputs.RUBOCOP == 'true' + uses: d-lebed/rubocop-run-action@v0.11.0 + with: + options: --format=RdjsonFormatter --out=reviewdog-report.json --format=progress + rdjson_formatter: ${{ inputs.REVIEWDOG }} + preserve_exitcode: false + + - name: Post Review + if: inputs.REVIEWDOG == 'true' && inputs.RUBOCOP == 'true' + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} + run: | + reviewdog \ + -reporter=github-pr-review \ + -filter-mode=added \ + -f=rdjson \ + < reviewdog-report.json + shell: bash - name: Split the input variable RUBY_RAKE_COMMANDS into an array and execute if: inputs.RUBY_RAKE_COMMANDS != null From f64d762ad9ef43b816e9df4c24cf5b2fe3117319 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 17:01:36 -0700 Subject: [PATCH 41/43] one more time without eval --- .github/actions/test-ruby/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index cf7ef179..67970473 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -56,7 +56,7 @@ runs: run: | echo "$ADDITIONAL_SETUP" | jq -r '.[]' | while read -r command; do echo "Executing additional setup command: $command" - eval "$command" + $command done - uses: actions/cache@v4 From d6c0fb871729d9a997d14ef7d70d6b511c25b784 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 17:05:51 -0700 Subject: [PATCH 42/43] all specs --- .github/actions/test-ruby/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-ruby/action.yml b/.github/actions/test-ruby/action.yml index 67970473..8c2fca40 100644 --- a/.github/actions/test-ruby/action.yml +++ b/.github/actions/test-ruby/action.yml @@ -140,7 +140,7 @@ runs: - name: Run Tests run: | - bundle exec rspec -f j -o tmp/rspec_results.json -f p spec/services/data_sphere/extractor_spec.rb:14 + bundle exec rspec -f j -o tmp/rspec_results.json -f p shell: bash - name: RSpec Report From 6e5f99932067b16fd4be7616c52139746c1eca7d Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Wed, 18 Sep 2024 17:25:48 -0700 Subject: [PATCH 43/43] remove branches --- .github/workflows/ci-build.yml | 2 +- .github/workflows/ci-check.yml | 2 +- .github/workflows/ci.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7731d006..703db0ae 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -224,7 +224,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: ryanwi/additional-setup + ref: main path: actions - uses: ./actions/.github/actions/gpg diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index b85c956d..eb15e93d 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -156,7 +156,7 @@ jobs: uses: actions/checkout@v4 with: repository: signalwire/actions-template - ref: ryanwi/additional-setup + ref: main path: actions - name: Retrieve Secrets from HashiCorp Vault diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6a37a96..b4ff3e30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,7 +216,7 @@ jobs: CHECK: name: CI - uses: signalwire/actions-template/.github/workflows/ci-check.yml@ryanwi/additional-setup + uses: signalwire/actions-template/.github/workflows/ci-check.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }} @@ -255,7 +255,7 @@ jobs: BUILD: name: BUILD needs: CHECK - uses: signalwire/actions-template/.github/workflows/ci-build.yml@ryanwi/additional-setup + uses: signalwire/actions-template/.github/workflows/ci-build.yml@main with: ENVIRONMENT: ${{ inputs.ENVIRONMENT }} PROJECT_NAME: ${{ inputs.PROJECT_NAME }}