Test #3564
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
name: Test | |
on: | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
MONGODB_TEST_OUTPUT_URI: | |
required: true | |
DOCKER_PUBLIC_READONLY_PAT: | |
required: true | |
env: | |
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }} | |
jobs: | |
test_go: | |
# note: we have automations that match on platform_name. be careful changing this. | |
name: ${{ matrix.platform_name }} Go Unit Tests | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: ubuntu-large | |
image: ghcr.io/viamrobotics/rdk-devenv:amd64 | |
platform: linux/amd64 | |
platform_name: linux-amd64 | |
runs-on: ${{ matrix.arch }} | |
container: | |
image: ${{ matrix.image }} | |
options: --platform ${{ matrix.platform }} | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.event.ref }} | |
- name: py version | |
run: | | |
python3 --version | |
which -a python3 | |
sudo apt install -qy lsb-release | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- 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: Chown | |
run: chown -R testbot:testbot . | |
- name: Run go unit tests | |
run: | | |
which -a python3 | |
which python3 | |
python3 --version | |
python3 -m venv .venv | |
.venv/bin/python --version | |
echo $PATH | |
whoami | |
echo $HOME | |
export PATH=$PATH | |
go test ./cli -run TestGenerateModuleAction | |
sudo --preserve-env=PATH -Hu testbot bash -lc 'go test ./cli -run TestGenerateModuleAction' | |
- name: Upload test.json | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-${{ matrix.platform_name }}.json | |
path: json.log | |
retention-days: 30 |