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

Fix Codecov failing on Dependabot PRs and clean up code coverage reporting #375

Merged
merged 5 commits into from
Mar 14, 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
26 changes: 15 additions & 11 deletions .github/workflows/web-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,25 @@ jobs:
- name: Run tests and generate coverage file
run: npm run ci:test

- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v3
with:
coverage-files: ./app/lcov*.info
minimum-coverage: 40
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./app
update-comment: true
# - name: Setup LCOV
# uses: hrishikesh-kadam/setup-lcov@v1
# - name: Report code coverage
# uses: zgosalvez/github-actions-report-lcov@v3
# with:
# coverage-files: ./app/lcov*.info
# minimum-coverage: 40
# artifact-name: code-coverage-report
# github-token: ${{ secrets.GITHUB_TOKEN }}
# working-directory: ./app
# update-comment: true

- name: Upload coverage reports to Codecov
continue-on-error: true
uses: codecov/[email protected]
with:
fail_ci_if_error: false
flag: unittests
name: citycatalyst-backend
token: ${{ secrets.CODECOV_TOKEN }}
slug: Open-Earth-Foundation/CityCatalyst

Expand Down
61 changes: 30 additions & 31 deletions .github/workflows/web-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
- k8s/cc-migrate.yml
- k8s/cc-web-deploy.yml
- k8s/cc-web.yml
- .github/workflows/web-actions.yml
- .github/workflows/web-tag.yml
tags:
- '^v\d+\.\d+\.\d+$'
- '^v\d+\.\d+\.\d+$'

jobs:
runTests:
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache: "npm"
cache-dependency-path: app/package-lock.json

- name: Install dependencies
Expand Down Expand Up @@ -59,34 +59,33 @@ jobs:
needs: runTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pushing citycatalyst to GHCR
env:
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
IMAGE: ghcr.io/open-earth-foundation/citycatalyst
- name: Pushing citycatalyst to GHCR
env:
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
IMAGE: ghcr.io/open-earth-foundation/citycatalyst

run: |
export VERSION=${REF#refs/tags/v}
export MAJOR=${VERSION%.*.*}
export MINOR=${VERSION%.*}
echo Version: ${VERSION} Major: ${MAJOR} Minor: ${MINOR}
docker build -t $IMAGE:$SHA app
docker tag $IMAGE:$SHA $IMAGE:$VERSION
docker tag $IMAGE:$SHA $IMAGE:$MAJOR
docker tag $IMAGE:$SHA $IMAGE:$MINOR
docker tag $IMAGE:$SHA $IMAGE:stable
docker push $IMAGE:$SHA
docker push $IMAGE:$VERSION
docker push $IMAGE:$MAJOR
docker push $IMAGE:$MINOR
docker push $IMAGE:stable
run: |
export VERSION=${REF#refs/tags/v}
export MAJOR=${VERSION%.*.*}
export MINOR=${VERSION%.*}
echo Version: ${VERSION} Major: ${MAJOR} Minor: ${MINOR}
docker build -t $IMAGE:$SHA app
docker tag $IMAGE:$SHA $IMAGE:$VERSION
docker tag $IMAGE:$SHA $IMAGE:$MAJOR
docker tag $IMAGE:$SHA $IMAGE:$MINOR
docker tag $IMAGE:$SHA $IMAGE:stable
docker push $IMAGE:$SHA
docker push $IMAGE:$VERSION
docker push $IMAGE:$MAJOR
docker push $IMAGE:$MINOR
docker push $IMAGE:stable
30 changes: 15 additions & 15 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"bcrypt": "^5.1.1",
"csv-parse": "^5.5.2",
"eslint": "8.56.0",
"eslint-config-next": "14.1.0",
"eslint-plugin-storybook": "^0.6.13",
"eslint-config-next": "^14.1.3",
"eslint-plugin-storybook": "^0.8.0",
"exceljs": "^4.4.0",
"fetch-blob": "^4.0.0",
"fetch-mock": "^9.11.0",
Expand Down
Loading