Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RSDK-7953] Consolidate build workflow for all archs part 2 #48

Merged
merged 10 commits into from
Sep 16, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Integration test using mediamtx

on: [push, pull_request]
on: push
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the workflow to run twice. Just need push here


jobs:
build-and-test:
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@ jobs:
publish:
strategy:
matrix:
platform: [linux/amd64, linux/arm64, android/arm64]

runs-on: ${{ matrix.platform == 'linux/arm64' && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-latest' }}
include:
- platform: linux/amd64
runner: ubuntu-latest
target_os: linux
target_arch: amd64
- platform: linux/arm64
runner: buildjet-8vcpu-ubuntu-2204-arm
target_os: linux
target_arch: arm64
- platform: android/arm64
runner: ubuntu-latest
target_os: android
target_arch: arm64

runs-on: ${{ matrix.runner }}

steps:
- uses: actions/checkout@v3
Expand All @@ -20,15 +32,18 @@ jobs:
with:
go-version: 1.21.13

- name: Install canon (only for non-Android platforms)
if: ${{ matrix.target_os != 'android' }}
run: |
export PATH="$(go env GOPATH)/bin:$PATH"
go install github.com/viamrobotics/[email protected]

- name: Build and package
run: |
if [[ "${{ matrix.platform }}" == "linux/amd64" ]]; then
TARGET_OS=linux TARGET_ARCH=amd64 make module
elif [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then
TARGET_OS=linux TARGET_ARCH=arm64 make module
elif [[ "${{ matrix.platform }}" == "android/arm64" ]]; then
TARGET_OS=android TARGET_ARCH=arm64 make module
if [ "${{ matrix.target_os }}" != "android" ]; then
canon --profile viam-rtsp-antique
fi
TARGET_OS=${{ matrix.target_os }} TARGET_ARCH=${{ matrix.target_arch }} make module

- name: Upload viamrtsp module to registry
uses: viamrobotics/upload-module@main
Expand Down
Loading