-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Zach Aller <[email protected]>
- Loading branch information
Showing
4 changed files
with
101 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ on: | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | ||
required: false | ||
default: false | ||
env: | ||
# Golang version to use across CI steps | ||
GOLANG_VERSION: '1.22' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -33,6 +36,50 @@ jobs: | |
with: | ||
name: Event File | ||
path: ${{ github.event_path }} | ||
test-unit: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore go build cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/go-build | ||
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }} | ||
|
||
- name: Download all Go modules | ||
run: | | ||
go mod download | ||
- name: Test | ||
run: make test-unit | ||
|
||
- name: Upload Unit Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Unit Test Results | ||
path: | | ||
junit.xml | ||
- name: Generate code coverage artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage | ||
path: coverage.out | ||
# - name: Upload code coverage information to codecov.io | ||
# uses: codecov/[email protected] | ||
# with: | ||
# file: coverage.out | ||
# fail_ci_if_error: false | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
test-e2e: | ||
strategy: | ||
fail-fast: false | ||
|
@@ -96,3 +143,30 @@ jobs: | |
name: e2e-controller-k8s-${{ matrix.kubernetes-minor-version }}.log | ||
path: /tmp/e2e-controller.log | ||
if: ${{ always() }} | ||
- name: Generate code coverage artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: e2e-coverage-output | ||
path: e2e-coverage-output | ||
coverage-process: | ||
name: Run end-to-end tests | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test-unit | ||
- test-e2e | ||
steps: | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
id: go | ||
- name: Get e2e code coverage | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: e2e-coverage-output | ||
path: e2e-coverage-output | ||
- name: Get unit test code coverage | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: code-coverage | ||
path: coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,30 +72,30 @@ jobs: | |
- name: Compile all packages | ||
run: make controller plugin | ||
|
||
- name: Test | ||
run: make test-unit | ||
|
||
- name: Upload Unit Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Unit Test Results | ||
path: | | ||
junit.xml | ||
- name: Generate code coverage artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage | ||
path: coverage.out | ||
|
||
- name: Upload code coverage information to codecov.io | ||
uses: codecov/[email protected] | ||
with: | ||
file: coverage.out | ||
fail_ci_if_error: false | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
# - name: Test | ||
# run: make test-unit | ||
# | ||
# - name: Upload Unit Test Results | ||
# if: always() | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: Unit Test Results | ||
# path: | | ||
# junit.xml | ||
# | ||
# - name: Generate code coverage artifacts | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: code-coverage | ||
# path: coverage.out | ||
# | ||
# - name: Upload code coverage information to codecov.io | ||
# uses: codecov/[email protected] | ||
# with: | ||
# file: coverage.out | ||
# fail_ci_if_error: false | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
codegen: | ||
name: Verify Codegen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ plugin-bin/ | |
# static | ||
server/static/* | ||
!server/static/.gitkeep | ||
e2e-coverage-output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters