Skip to content

Commit

Permalink
rollback since it's not accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkouv committed Oct 3, 2024
1 parent e4f4591 commit 4f861ae
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/ccip-ocr3-build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,20 @@ jobs:
- name: Run linter
run: make lint
- name: Run tests
run: |
go get ./...
{ time TEST_COUNT=1 COVERAGE_FILE=coverage.out make test; } 2> test-results.txt
real_time=$(cat test-results.txt | grep real | awk '{print $2}')
echo "Tests duration: $real_time"
echo "tests_duration=$real_time" >> $GITHUB_ENV
run: TEST_COUNT=1 COVERAGE_FILE=coverage.out make test
- name: Generate coverage report
if: github.event_name == 'pull_request'
run: |
total=$(go tool cover -func=coverage.out | grep total | awk '{print $3}')
echo "coverage=$total" >> $GITHUB_ENV
- name: Coverage and duration on target branch
- name: Coverage on target branch
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}
git checkout ${{ github.base_ref }}
{ time TEST_COUNT=1 COVERAGE_FILE=coverage_target.out make test; } 2> test-results.txt
real_time=$(cat test-results.txt | grep real | awk '{print $2}')
echo "tests_duration_target=$real_time" >> $GITHUB_ENV
TEST_COUNT=1 COVERAGE_FILE=coverage_target.out make test
total=$(go tool cover -func=coverage_target.out | grep total | awk '{print $3}')
echo "coverage_target=$total" >> $GITHUB_ENV
echo "Tests duration: $real_time"
- name: Remove previous coverage comments
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -83,11 +75,9 @@ jobs:
script: |
const coverage = process.env.coverage;
const coverage_target = process.env.coverage_target;
const tests_duration = process.env.tests_duration;
const tests_duration_target = process.env.tests_duration_target;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `| Metric | \`${{ github.head_ref }}\` | \`${{ github.base_ref }}\` | \n|--------------|--|--|\n| **Coverage** | ${coverage} | ${coverage_target} |\n| **Tests Duration** | ${tests_duration} | ${tests_duration_target} |`
body: `| Metric | \`${{ github.head_ref }}\` | \`${{ github.base_ref }}\` |\n|--|--|--|\n| **Coverage** | ${coverage} | ${coverage_target} |`
});

0 comments on commit 4f861ae

Please sign in to comment.