Skip to content

Commit

Permalink
fix: ci fix tests off fork
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticspoon committed May 21, 2024
1 parent b9d6bd5 commit f0431f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/combine_and_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@ on:
jobs:
combine_and_report:
runs-on: ubuntu-latest
env:
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
steps:
- name: Checkout Project
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Decompress chunk test reports
run: |
find artifacts -name "test_reports*.zip" -exec unzip -d test_reports {} \;
find test_reports -name "**/test_reports*.zip" -exec unzip -d test_reports {} \;
- name: Merge parallel runtime log parts
if: env.AZURE_STORAGE_KEY != ''
run: |
cat artifacts/**/parallel_runtime_rspec*.log > parallel_runtime.log
- name: Upload log file to Azure Blob Storage
env:
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
if: env.AZURE_STORAGE_KEY != ''
run: |
az storage blob upload \
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/rspec_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
env:
GROUPS_COMMA: ${{ join(fromJSON(inputs.groups), ',') }}
GROUPS_UNDERSCORE: ${{ join(fromJSON(inputs.groups), '_') }}
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}

jobs:
rspec_parallel:
Expand Down Expand Up @@ -42,10 +45,6 @@ jobs:
- uses: actions/checkout@v4

- name: Download parallel runtime log from Azure Blob Storage
env:
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
if: env.AZURE_STORAGE_KEY != ''
run: |
az storage blob download \
Expand Down Expand Up @@ -104,18 +103,18 @@ jobs:
CC_TEST_REPORTER_ID: 31464536e34ab26588cb951d0fa6b5898abdf401dbe912fd47274df298e432ac
continue-on-error: true
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
# curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
# chmod +x ./cc-test-reporter
# ./cc-test-reporter before-build
RUBYOPT='-W:no-deprecated -W:no-experimental' bundle exec parallel_rspec \
-n "${CI_TOTAL_JOBS}" \
--only-group "${CI_JOB_INDEX}" \
--runtime-log old_parallel_runtime.log \
--verbose ./spec
echo 'Tests completed. Uploading to Code Climate'
./cc-test-reporter after-build --exit-code $?
# echo 'Tests completed. Uploading to Code Climate'
# ./cc-test-reporter after-build --exit-code $?
cat tmp/spec_summary.log
- name: Compress reports
Expand Down

0 comments on commit f0431f5

Please sign in to comment.