Split unittests to linux and non-linux to speedup CI execution
linux is one group and windows & mac are another. Systests will wait only for Linux execution.
@@ -151,15 +151,9 @@ jobs:
matrix:
os:
- ubuntu-latest
- - macos-latest
- - windows-latest
include:
- os: ubuntu-latest
allow-failure: "false"
- - os: macos-latest
- allow-failure: "true"
- - os: windows-latest
- allow-failure: "true"
steps:
# as we use some request to localhost, sometimes it gives us flaky tests. try to disable tcp offloading for fix it
# https://github.com/actions/virtual-environments/issues/1187
@@ -168,6 +162,58 @@ jobs:
run: |
sudo ethtool -K eth0 tx off
sudo ethtool -K eth0 rx off
+ - name: checkout
+ uses: actions/checkout@v3
+ - name: set up go
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ env.go-version }}
+ - uses: actions/cache@v3
+ with:
+ path: |
+ ~/go/pkg/mod
+ ~/.cache/go-build
+ key: ${{ runner.os }}-cache-go-${{ env.go-version }}-unittests-${{ hashFiles('**/go.sum') }}
+ restore-keys: |
+ ${{ runner.os }}-cache-go-${{ env.go-version }}-unittests-
+ ${{ runner.os }}-cache-go-${{ env.go-version }}-
+ - name: setup env
+ run: make install
+ - name: Clear test cache
+ run: make clear-test-cache
+ - name: unit tests
+ timeout-minutes: 25
+ env:
+ GOTESTSUM_FORMAT: standard-verbose
+ GOTESTSUM_JUNITFILE: unit-tests.xml
+ run: make test
+ continue-on-error: ${{ matrix.allow-failure == 'true' }}
+ - name: Publish Test Report
+ uses: mikepenz/action-junit-report@v3
+ # always run even if the previous step fails
+ if: always()
+ with:
+ report_paths: "**/unit-tests.xml"
+ annotate_only: true
+ fail_on_failure: ${{ matrix.allow-failure == 'false' }}
+
+
+ unittests-slower:
+ runs-on: ${{ matrix.os }}
+ needs: filter-changes
+ if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
+ strategy:
+ fail-fast: true
+ matrix:
+ os:
+ - macos-latest
+ - windows-latest
+ include:
+ - os: macos-latest
+ allow-failure: "true"
+ - os: windows-latest
+ allow-failure: "true"
+ steps:
- name: disable TCP/UDP offload
if: ${{ matrix.os == 'macos-latest' }}
run: |
@@ -212,6 +258,7 @@ jobs:
annotate_only: true
fail_on_failure: ${{ matrix.allow-failure == 'false' }}
+
# checkpoint and print a single, clean status message to slack
ci-stage1:
# run regardless of status of previous jobs but skip if the required secret is not accessible
