Skip to content

APP-15334: Adding annotation confidence to viam dataset export #2532

APP-15334: Adding annotation confidence to viam dataset export

APP-15334: Adding annotation confidence to viam dataset export #2532

Workflow file for this run

name: Test
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request_target:
branches: [ main ]
types: [ labeled ]
jobs:
test_passing:
name: All Tests Passing
needs: [test_go, test_win]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check Results
run: |
echo Main Tests: ${{ needs.test_go.result }}
echo Windows Tests: ${{ needs.test_win.result }}
[ "${{ needs.test_go.result }}" == "success" ] && \
[ "${{ needs.test_win.result }}" == "success" ]
test_go:
name: ubuntu
runs-on: ubuntu-latest
timeout-minutes: 20
if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'push' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe to test' && contains(github.event.pull_request.labels.*.name, 'safe to test'))
steps:
- name: Check out main branch code
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check out PR branch code
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- name: Install toolchain
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
with:
experimental: true
- name: Extract go version from mise
id: go-version
run:
echo "version=$(mise tool go --active)" >> $GITHUB_OUTPUT
# Go was already installed by mise but setup-go will also cache our module dependencies.
- uses: actions/setup-go@v5
with:
go-version: ${{ steps.go-version.outputs.version }}
- name: Set main env vars
if: github.event_name != 'pull_request_target'
run: |
echo "GITHUB_X_HEAD_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
echo "GITHUB_X_HEAD_REF=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Set PR env vars
if: github.event_name == 'pull_request_target'
env:
GITHUB_HEAD_REF_SAN: ${{ github.event.pull_request.head.label }}
run: |
echo "GITHUB_X_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "GITHUB_X_HEAD_REF=${GITHUB_HEAD_REF_SAN}" >> $GITHUB_ENV
echo "GITHUB_X_PR_BASE_SHA=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
echo "GITHUB_X_PR_BASE_REF=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
- name: Verify no uncommitted changes
run: |
git init
git add .
mise run build ::: lint
GEN_DIFF=$(git status -s)
if [ -n "$GEN_DIFF" ]; then
echo '"mise run build ::: lint" resulted in the following untracked changes:' 1>&2
git diff
echo '"mise run build ::: lint" resulted in changes not in git' 1>&2
git status
exit 1
fi
- name: Test go library
env:
TEST_MONGODB_URI: ${{ secrets.TEST_MONGODB_URI }}
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}
run: |
echo "${{ secrets.ARTIFACT_GOOGLE_APPLICATION_CREDENTIALS }}" | base64 -d > artifact_google_creds.json
export ARTIFACT_GOOGLE_APPLICATION_CREDENTIALS=`pwd`/artifact_google_creds.json
mise run cover
- name: Upload test.json
if: always()
uses: actions/upload-artifact@v4
with:
name: test.json
path: json.log
retention-days: 30
# this one runs as root for CAP_SETUID
- name: test run-as-user
env:
TEST_SUBPROC_USER: subproc_user
run: |
sudo useradd $TEST_SUBPROC_USER
sudo go test -v ./pexec -run TestManagedProcessStart
test_win:
name: windows
runs-on: windows-2025
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install toolchain
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac
with:
experimental: true
- name: test
env:
GOFLAGS: "-tags=no_cgo"
# note: tests do not pass on the default powershell, but do pass in bash.
shell: bash
# note: this is a subset of tests that are known to pass on windows
run: |
gotestsum --format standard-verbose --jsonfile json.log ./pexec
- name: Upload test.json
if: always()
uses: actions/upload-artifact@v4
with:
name: test-windows-amd64.json
path: json.log
retention-days: 30