1313 paths-ignore : [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]
1414
1515env :
16- GO_VERSION : ' 1.24.9'
16+ GO_VERSION : ' 1.24.13'
17+ CERT_MANAGER_VERSION : ' v1.16.2'
1718
1819jobs :
1920 detect-noop :
2930 do_not_skip : ' ["workflow_dispatch", "schedule", "push"]'
3031 concurrent_skipping : false
3132
32- unit-tests :
33+ unit-and-integration- tests :
3334 runs-on : ubuntu-latest
3435 needs : detect-noop
3536 if : needs.detect-noop.outputs.noop != 'true'
@@ -40,23 +41,48 @@ jobs:
4041 go-version : ${{ env.GO_VERSION }}
4142
4243 - name : Check out code into the Go module directory
43- uses : actions/checkout@v6.0.1
44+ uses : actions/checkout@v6.0.2
4445
4546 - name : Set up Ginkgo CLI
4647 run : |
4748 go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
4849
49- - name : Run unit tests & Generate coverage
50- run : make test
50+ - name : Prepare necessary environment variables
51+ run : |
52+ echo "CGO_ENABLED=1" >> $GITHUB_ENV
53+ KUBEBUILDER_ASSETS=$(make --silent kubebuilder-assets-path)
54+ echo "KUBEBUILDER_ASSETS="$KUBEBUILDER_ASSETS"" >> $GITHUB_ENV
55+
56+ # Certain tests that require special setup (e.g., those that should be run with Ginkgo CLI only) will
57+ # be skipped in this step.
58+ #
59+ # Note that the skipping only applies to the CI environment.
60+ - name : Run unit and integration tests with default setup & generate coverage
61+ run : |
62+ make test
63+ env :
64+ KUBEFLEET_CI_TEST_RUNNER_NAME : ' default'
65+
66+ # The work applier integration tests use in-memory Kubernetes environment setup; due to resource constraints
67+ # and the way the tests are organized, running the suite with as many parallel Ginkgo processes as possible (i.e.,
68+ # the number of all CPU cores) might not lead to the optimal outcome.
69+ #
70+ # Note (chenyu1): switch to test matrices if we need to test with more configuration combos in the future.
71+ - name : Run work applier unit and integration tests with Ginkgo CLI & generate coverage
72+ run : |
73+ ginkgo -v -p --procs=4 --race --cover -coverprofile=work-applier-it-coverage.out ./pkg/controllers/workapplier/
74+ KUBEFLEET_CI_WORK_APPLIER_RUN_WITH_PRIORITY_QUEUE=true ginkgo -v -p --procs=4 --race --cover -coverprofile=work-applier-it-no-pri-q-coverage.out ./pkg/controllers/workapplier/
75+ env :
76+ KUBEFLEET_CI_TEST_RUNNER_NAME : ' ginkgo'
5177
5278 - name : Upload Codecov report
5379 uses : codecov/codecov-action@v5
5480 with :
55- # # Repository upload token - get it from codecov.io. Required only for private repositories
81+ # # Repository upload token - get it from codecov.io. Required only for private repositories
5682 token : ${{ secrets.CODECOV_TOKEN }}
57- # # Comma-separated list of files to upload
58- files : ./ut-coverage.xml
59-
83+ # The codecov action will auto-search all coverage files by default. All uploaded coverage will be
84+ # merged automatically.
85+
6086 e2e-tests :
6187 strategy :
6288 fail-fast : false
90116 go-version : ${{ env.GO_VERSION }}
91117
92118 - name : Check out code into the Go module directory
93- uses : actions/checkout@v6.0.1
119+ uses : actions/checkout@v6.0.2
94120
95121 - name : Move Docker data directory to /mnt
96122 # The default storage device on GitHub-hosted runners is running low during e2e tests.
@@ -143,7 +169,8 @@ jobs:
143169 PROPERTY_PROVIDER : ' azure'
144170 RESOURCE_SNAPSHOT_CREATION_MINIMUM_INTERVAL : ${{ matrix.resource-snapshot-creation-minimum-interval }}
145171 RESOURCE_CHANGES_COLLECTION_DURATION : ${{ matrix.resource-changes-collection-duration }}
146-
172+ CERT_MANAGER_VERSION : ${{ env.CERT_MANAGER_VERSION }}
173+
147174 - name : Collect logs
148175 if : always()
149176 # Wait for a bit before log collection; this gives the agent pods some time to shut down
@@ -157,7 +184,7 @@ jobs:
157184
158185 - name : Upload logs
159186 if : always()
160- uses : actions/upload-artifact@v5
187+ uses : actions/upload-artifact@v6
161188 with :
162189 name : e2e-logs-${{ matrix.customized-settings }}
163190 path : test/e2e/logs-${{ matrix.customized-settings }}/
0 commit comments