From 8c1174e3059c580fa36a9c0fedf06a3fc02d88fe Mon Sep 17 00:00:00 2001 From: Nandika Jayawardana Date: Mon, 22 Apr 2024 15:36:38 +0530 Subject: [PATCH 1/2] Create coverage.yml workflow --- .github/workflows/coverage.yml | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..794282aa --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,43 @@ +name: Code coverage upload workflow (codecov) + +on: + schedule: + - cron: '0 20 * * *' + workflow_dispatch: + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + build-and-upload-coverage: + runs-on: ubuntu-latest + steps: + - name: Run hostname + run: hostname + - name: Fix host entry + run: sudo echo "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts + - name: Show hosts + run: cat /etc/hosts + - name: Checkout master + uses: actions/checkout@v3 + with: + fetch-depth: '10' + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: 'adopt' + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2 + restore-keys: ${{ runner.os }}-m2 + - name: Build with tests + run: mvn clean install --file pom.xml + - name: Upload test coverage to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + flags: unit_tests + token: ${{ secrets.CODECOV_TOKEN }} + slug: wso2/carbon-analytics-common From 1e85805c5cf94bfb151aca6289754b39f2823956 Mon Sep 17 00:00:00 2001 From: Nandika Jayawardana Date: Thu, 25 Apr 2024 15:22:52 +0530 Subject: [PATCH 2/2] Update coverage.yml --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 794282aa..367270b5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,4 +40,4 @@ jobs: with: flags: unit_tests token: ${{ secrets.CODECOV_TOKEN }} - slug: wso2/carbon-analytics-common + slug: wso2/carbon-metrics