|
84 | 84 | path: json.log
|
85 | 85 | retention-days: 30
|
86 | 86 |
|
87 |
| - test_coverage: |
88 |
| - name: Go Coverage Tests |
89 |
| - if: false # toggle this off, delete after 3/1/24 if nobody misses it |
90 |
| - # note: we split 'test_go' and 'test_coverage' steps because running race-detection + covprofile simultaneously is slow enough to cause flakes |
91 |
| - strategy: |
92 |
| - fail-fast: false |
93 |
| - matrix: |
94 |
| - include: |
95 |
| - - arch: ubuntu-large |
96 |
| - image: ghcr.io/viamrobotics/rdk-devenv:amd64-cache |
97 |
| - platform: linux/amd64 |
98 |
| - platform_name: linux-amd64 |
99 |
| - - arch: ubuntu-large-arm |
100 |
| - image: ghcr.io/viamrobotics/rdk-devenv:arm64-cache |
101 |
| - platform: linux/arm64 |
102 |
| - platform_name: linux-arm64 |
103 |
| - runs-on: ${{ matrix.arch }} |
104 |
| - container: |
105 |
| - image: ${{ matrix.image }} |
106 |
| - options: --platform ${{ matrix.platform }} |
107 |
| - timeout-minutes: 30 |
108 |
| - |
109 |
| - steps: |
110 |
| - - uses: actions/checkout@v3 |
111 |
| - with: |
112 |
| - ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.event.ref }} |
113 |
| - fetch-depth: ${{ github.event_name == 'pull_request_target' && '0' || '1' }} # 0 aka full history, so we can analyze history for coverage |
114 |
| - |
115 |
| - - name: Set main env vars |
116 |
| - if: github.event_name != 'pull_request_target' |
117 |
| - run: | |
118 |
| - echo "GITHUB_X_HEAD_SHA=${GITHUB_SHA}" >> $GITHUB_ENV |
119 |
| - echo "GITHUB_X_HEAD_REF=${GITHUB_REF_NAME}" >> $GITHUB_ENV |
120 |
| -
|
121 |
| - - name: Set PR env vars |
122 |
| - if: github.event_name == 'pull_request_target' |
123 |
| - env: |
124 |
| - GITHUB_HEAD_REF_SAN: ${{ github.event.pull_request.head.label }} |
125 |
| - run: | |
126 |
| - echo "GITHUB_X_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV |
127 |
| - echo "GITHUB_X_HEAD_REF=${GITHUB_HEAD_REF_SAN}" >> $GITHUB_ENV |
128 |
| - echo "GITHUB_X_PR_BASE_SHA=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV |
129 |
| - echo "GITHUB_X_PR_BASE_REF=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV |
130 |
| -
|
131 |
| - - name: chown |
132 |
| - run: chown -R testbot:testbot . |
133 |
| - |
134 |
| - - name: Verify no uncommitted changes from "make build-go lint-go generate-go" |
135 |
| - run: | |
136 |
| - sudo -Hu testbot bash -lc 'git init && git add . && make build-go lint-go generate-go' |
137 |
| - GEN_DIFF=$(git status -s) |
138 |
| -
|
139 |
| - if [ -n "$GEN_DIFF" ]; then |
140 |
| - echo '"make build-go lint-go generate-go" resulted in changes not in git' 1>&2 |
141 |
| - git status |
142 |
| - exit 1 |
143 |
| - fi |
144 |
| -
|
145 |
| - - name: Run go coverage tests |
146 |
| - run: | |
147 |
| - sudo --preserve-env=MONGODB_TEST_OUTPUT_URI,GITHUB_SHA,GITHUB_RUN_ID,GITHUB_RUN_NUMBER,GITHUB_RUN_ATTEMPT,GITHUB_X_PR_BASE_SHA,GITHUB_X_PR_BASE_REF,GITHUB_X_HEAD_REF,GITHUB_X_HEAD_SHA,GITHUB_REPOSITORY -Hu testbot bash -lc 'make cover-only' |
148 |
| -
|
149 |
| - - name: Upload code coverage |
150 |
| - uses: actions/upload-artifact@v4 |
151 |
| - with: |
152 |
| - name: pr-code-coverage |
153 |
| - path: | |
154 |
| - pr.env |
155 |
| - code-coverage-results.md |
156 |
| - retention-days: 1 |
157 |
| - |
158 | 87 | test32:
|
159 | 88 | name: Go 32-bit Unit Tests
|
160 | 89 | runs-on: ubuntu-large-arm
|
|
0 commit comments