Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove coverall upload + upload summary to Cloud Storage #94

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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