From 1d26b1b69a723170182ad18840672fccaa4eb13f Mon Sep 17 00:00:00 2001 From: nandika Date: Sat, 27 Apr 2024 12:01:34 +0530 Subject: [PATCH 1/3] Create coverage.yml which builds and upload code coverage data to codecov --- .github/workflows/coverage.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 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 0000000000..fa9c0b898c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,41 @@ +name: Coverage workflow Uploader + +on: + push: + branches: [ "5.3.x" ] + pull_request: + branches: [ "5.3.x" ] + 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: Checkout master + uses: actions/checkout@v3 + with: + fetch-depth: '10' + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: 'temurin' + - 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 a4eadc017cecb22d989af00710518aca15698d7a Mon Sep 17 00:00:00 2001 From: nandika Date: Sat, 27 Apr 2024 12:08:16 +0530 Subject: [PATCH 2/3] coverage.yml updated to use JDK8 --- .github/workflows/coverage.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fa9c0b898c..71f44d9606 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -3,8 +3,6 @@ name: Coverage workflow Uploader on: push: branches: [ "5.3.x" ] - pull_request: - branches: [ "5.3.x" ] schedule: - cron: '0 20 * * *' workflow_dispatch: @@ -20,10 +18,10 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: '10' - - name: Set up JDK 11 + - name: Set up JDK 8 uses: actions/setup-java@v2 with: - java-version: 11 + java-version: 8 distribution: 'temurin' - name: Cache Maven packages uses: actions/cache@v3 From 605c3b30298163b4a6756b3ea4a9a56ba2f90917 Mon Sep 17 00:00:00 2001 From: nandika Date: Sat, 27 Apr 2024 12:19:38 +0530 Subject: [PATCH 3/3] coverage.yml updated to use JDK8 --- .github/workflows/coverage.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 71f44d9606..66e590c648 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,6 +14,12 @@ 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: