Skip to content

Commit

Permalink
Merge pull request #94 from reside-eng/PLAT-8743-remove-coveralls-upload
Browse files Browse the repository at this point in the history
feat: remove coverall upload + upload summary to Cloud Storage
  • Loading branch information
mathieudi authored Dec 11, 2024
2 parents f9454fc + bc05e3a commit 8e55e6d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-nodejs-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
required: false
type: string
secrets:
DEPENDENCY_STATS_SERVICE_ACCOUNT:
LIBRARY_CI_SERVICE_ACCOUNT:
required: true
NPM_READ_TOKEN:
required: true
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
uses: google-github-actions/auth@v2
with:
project_id: reside-stage
credentials_json: ${{ secrets.DEPENDENCY_STATS_SERVICE_ACCOUNT }}
credentials_json: ${{ secrets.LIBRARY_CI_SERVICE_ACCOUNT }}

# setup-gcloud without components is required to have the proper authentication for gsutil commands
- name: Set up Google Cloud CLI
Expand Down
36 changes: 31 additions & 5 deletions .github/workflows/release_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ on:
required: true
NPM_READ_TOKEN:
required: true
DEPENDENCY_STATS_SERVICE_ACCOUNT:
LIBRARY_CI_SERVICE_ACCOUNT:
required: true
#Secret needed when ENABLE_VISUAL_TESTING = true:
# - SIDE_CI_APPLICATION_ID
Expand All @@ -67,6 +67,8 @@ jobs:
name: release
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.TIMEOUT }}
env:
SERVICE_NAME: ${{ github.event.repository.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -102,11 +104,35 @@ jobs:
if: inputs.ENABLE_TESTING && inputs.ENABLE_COVERAGE
run: yarn test:cov

- name: Upload coverage to Coveralls
- name: Authenticate with Google Cloud
if: inputs.ENABLE_TESTING && inputs.ENABLE_COVERAGE
uses: coverallsapp/github-action@v2.3.4
uses: google-github-actions/auth@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
project_id: reside-stage
credentials_json: ${{ secrets.LIBRARY_CI_SERVICE_ACCOUNT }}

# setup-gcloud without components is required to have the proper authentication for gsutil commands
- name: Set up Google Cloud CLI
if: inputs.ENABLE_TESTING && inputs.ENABLE_COVERAGE
uses: google-github-actions/setup-gcloud@v2
with:
install_components: ''

- name: Upload coverage summary
if: inputs.ENABLE_TESTING && inputs.ENABLE_COVERAGE
run: |
coverage_summary="./coverage/coverage-summary.json"
if [ ! -f "$coverage_summary" ]; then
npx nyc report --reporter=json-summary -t coverage
fi
bucket=reside-stage-plat-tools
summaryFolder=coverage-reporting/summary
gsutil -m -q cp $coverage_summary gs://$bucket/$summaryFolder/$SERVICE_NAME/$(date +%Y-%m-%d_%H-%M-%S).json
gsutil -m -q cp $coverage_summary gs://$bucket/$summaryFolder/$SERVICE_NAME/latest.json
echo "Coverage summary file uploaded successfully"
- name: Build app
if: inputs.ENABLE_BUILDING
Expand Down Expand Up @@ -200,7 +226,7 @@ jobs:
NODE_VERSION: ${{ inputs.NODE_VERSION }}
secrets:
NPM_READ_TOKEN: ${{ secrets.NPM_READ_TOKEN }}
DEPENDENCY_STATS_SERVICE_ACCOUNT: ${{ secrets.DEPENDENCY_STATS_SERVICE_ACCOUNT }}
LIBRARY_CI_SERVICE_ACCOUNT: ${{ secrets.LIBRARY_CI_SERVICE_ACCOUNT }}

notification:
if: always() && inputs.ENABLE_SLACK_NOTIFICATION
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/verify_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ jobs:
if: inputs.ENABLE_TESTING && inputs.ENABLE_COVERAGE
run: yarn test:cov

- name: Upload coverage to Coveralls
if: inputs.ENABLE_TESTING && inputs.ENABLE_COVERAGE
uses: coverallsapp/github-action@v2.3.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build app
if: inputs.ENABLE_BUILDING
run: yarn build
Expand Down

0 comments on commit 8e55e6d

Please sign in to comment.