Skip to content

[WIP] -- codecov #2773

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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
3 changes: 1 addition & 2 deletions .codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ comment:
behavior: default
ignore:
- "testdata"
- "**/zz_*generated*.go"
- "**/zz*_generated.go"
- "templates"
- "hack"
- "test"
- "third_party"

63 changes: 63 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,69 @@ jobs:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

e2e-runtime-test:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add runtime tests into CI (runs on push to main)

continue-on-error: true
strategy:
matrix:
runtime: ["node", "go", "quarkus", "springboot", "typescript", "rust"]
runs-on: ubuntu-latest
steps:
- name: Set Environment Variables
run: |
echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV"
echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: knative/actions/setup-go@main
- name: Install Binaries
run: ./hack/install-binaries.sh
- name: Allocate Cluster
run: |
attempt=0
max_attempts=5
until [ $attempt -ge $max_attempts ]
do
attempt=$((attempt+1))
echo "------------------ Attempt $attempt for ${{matrix.runtime}} ------------------"
./hack/allocate.sh && break
echo "------------------ failed, retrying... ------------------"
if [ $attempt -ge $max_attempts ]; then
echo "------------------ max # of retries reached, exiting ------------------"
exit 1
fi
./hack/delete.sh
echo "------------------ sleep for 5 minutes ------------------"
sleep 300
done
echo "------------------ finished! attempt $attempt ------------------"
- name: Local Registry
run: ./hack/registry.sh
- name: Build
run: make
- name: E2E runtime for ${{ matrix.runtime }}
run: |
attempt=0
max_attempts=5
until [ $attempt -ge $max_attempts ]
do
attempt=$((attempt+1))
echo "------------------ Attempt $attempt for ${{matrix.runtime}} ------------------"
make test-e2e-runtime runtime=${{ matrix.runtime }} && break
echo "------------------ failed, retrying... ------------------"
if [ $attempt -ge $max_attempts ]; then
echo "------------------ max # of retries reached, exiting ------------------"
exit 1
fi
done
echo "------------------ finished! attempt $attempt ------------------"
- uses: codecov/codecov-action@v5
with:
files: ./coverage.txt
flags: e2e-test-runtime-${{ matrix.runtime }}
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}


build:
needs: [check, test-unit, test-integration, e2e-test, e2e-on-cluster-test]
runs-on: ubuntu-latest
Expand Down
47 changes: 27 additions & 20 deletions .github/workflows/test-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,31 @@ jobs:
- name: Template Unit Tests
if: matrix.os != 'ubuntu-latest'
run: make test-templates
- name: "Archive code coverage results"
uses: actions/upload-artifact@v4
# - name: "Archive code coverage results"
# uses: actions/upload-artifact@v4
# with:
# name: coverage-${{ matrix.os }}
# path: ./coverage.txt
# retention-days: 1
# upload-coverage:
# needs: [test]
# name: "Upload coverage"
# runs-on: "ubuntu-latest"
# steps:
# - uses: actions/checkout@v4
# - name: Download Coverage
# run: |
# gh run download -R ${{ github.repository }} ${{ github.run_id }}
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt
# flags: unit-tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
name: coverage-${{ matrix.os }}
path: ./coverage.txt
retention-days: 1
upload-coverage:
needs: [test]
name: "Upload coverage"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Download Coverage
run: |
gh run download -R ${{ github.repository }} ${{ github.run_id }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: codecov/codecov-action@v5
with:
files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt
flags: unit-tests
files: coverage.txt
flags: unit-tests-${{ matrix.os }}
name: codecov-${{ matrix.os }}
fail_ci_if_error: true
verbose: true

40 changes: 0 additions & 40 deletions pkg/docker/appease_coverage_gods_test.go

This file was deleted.

Loading