Skip to content

Commit

Permalink
feat: Add code climate to github actions (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik-sivadas authored Apr 11, 2024
1 parent 5266158 commit e7b0c7a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/integrations-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ jobs:
- name: Run tests with code coverage
run: COVERAGE=true bundle exec rspec
working-directory: ./integrations

- name: Install Code Climate Test Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./integrations/cc-test-reporter
chmod +x ./integrations/cc-test-reporter
working-directory: ./integrations

- name: Push coverage data to Code Climate
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
./integrations/cc-test-reporter before-build
./integrations/cc-test-reporter after-build --exit-code $?
working-directory: ./integrations
14 changes: 14 additions & 0 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@ jobs:
- name: Run Tests
run: bundle exec rspec
working-directory: ./server

- name: Install cc-test-reporter
if: github.event_name == 'push'
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./server/cc-test-reporter
chmod +x ./server/cc-test-reporter
working-directory: ./server

- name: Upload Coverage to Code Climate
if: github.event_name == 'push'
run: |
./server/cc-test-reporter before-build
./server/cc-test-reporter after-build --exit-code $?
working-directory: ./server
2 changes: 1 addition & 1 deletion .github/workflows/server-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
IMAGE_NAME: multiwoven/multiwoven-server
IMAGE_TAG: latest-main
IMAGE_TAG: edge

jobs:
build_and_push:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/ui-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: frontend-ci

on:
push:
branches: [main]
paths:
- "ui/**"
pull_request:
paths:
- "ui/**"
Expand All @@ -24,3 +28,17 @@ jobs:
- name: Run tests and collect coverage
run: npm test -- --coverage
working-directory: ./ui

- name: Upload coverage to Code Climate
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./ui/cc-test-reporter
chmod +x ./ui/cc-test-reporter
./ui/cc-test-reporter before-build
if [ -f coverage/lcov.info ]; then
./ui/cc-test-reporter after-build --exit-code $? --coverage-input-type lcov
else
echo "Coverage report not found."
fi
working-directory: ./ui
2 changes: 1 addition & 1 deletion .github/workflows/ui-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
IMAGE_NAME: multiwoven/multiwoven-ui
IMAGE_TAG: latest-main
IMAGE_TAG: edge

jobs:
build_and_push:
Expand Down

0 comments on commit e7b0c7a

Please sign in to comment.