Skip to content

Commit 46722c8

Browse files
authored
Create multi-arch build and upload workflow
1 parent 34b89fa commit 46722c8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/rust.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Modulr Agent Build & Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
arch: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf]
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Rust
20+
uses: actions/setup-rust@v2
21+
with:
22+
rust-version: stable
23+
24+
- name: Add target for cross-compilation
25+
run: rustup target add ${{ matrix.arch }}
26+
27+
- name: Install system dependencies
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y \
31+
libgstreamer1.0-dev \
32+
libgstreamer-plugins-base1.0-dev \
33+
gstreamer1.0-plugins-base \
34+
gstreamer1.0-plugins-good \
35+
gstreamer1.0-plugins-bad \
36+
gstreamer1.0-plugins-ugly \
37+
gstreamer1.0-libav \
38+
libgstrtspserver-1.0-dev \
39+
libges-1.0-dev
40+
41+
- name: Build project
42+
run: |
43+
echo "Building for target: ${{ matrix.arch }}"
44+
cargo build --release --target ${{ matrix.arch }}
45+
46+
- name: Run tests
47+
if: matrix.arch == 'x86_64-unknown-linux-gnu'
48+
run: cargo test --release
49+
50+
- name: Upload build artifacts
51+
uses: actions/upload-artifact@v3
52+
with:
53+
name: build-${{ matrix.arch }}
54+
path: target/${{ matrix.arch }}/release/

0 commit comments

Comments
 (0)