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

arm64 Dockerfile, lower Gstreamer version requirement #214

Merged
merged 18 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 44 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- "**.rs"
- "**/Cargo.lock"
- "**/Cargo.toml"
- "**/package.json"
- "**.svelte"
- "**.js"
- "**.ts"
branches:
- main
env:
Expand All @@ -17,38 +21,51 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
rust: [stable]
exclude:
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-unknown-linux-gnu
env:
RUST_BACKTRACE: full
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-cache
- name: Install gstreamer (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
shared-key: ${{ runner.target }}-rust-cache
- name: Install ${{ matrix.target }} packages (ubuntu-latest)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y libunwind-dev libgstreamer1.0-dev
- name: Install gstreamer (macos-latest)
- name: Install packages (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install gstreamer
brew install gstreamer
- name: Install Rust Toolchain
if: matrix.target != 'aarch64-unknown-linux-gnu'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
components: rustfmt, clippy
override: true
- name: Install Cargo Plugins
if: matrix.target != 'aarch64-unknown-linux-gnu'
run: cargo install cargo-make cargo-insta sqlx-cli
- name: Create db file
if: matrix.target != 'aarch64-unknown-linux-gnu'
run: "touch /tmp/data.db && cd hifirs && cargo sqlx database reset -y"
env:
DATABASE_URL: "sqlite:///tmp/data.db"
- name: Run CI Flow
if: matrix.target != 'aarch64-unknown-linux-gnu'
uses: actions-rs/cargo@v1
env:
QOBUZ_USERNAME: ${{secrets.QOBUZ_USERNAME}}
Expand All @@ -57,3 +74,24 @@ jobs:
with:
command: make
args: ci-flow
# - name: Check arm64
# uses: pguyot/arm-runner-action@v2
# if: matrix.target == 'aarch64-unknown-linux-gnu'
# env:
# QOBUZ_USERNAME: ${{secrets.QOBUZ_USERNAME}}
# QOBUZ_PASSWORD: ${{secrets.QOBUZ_PASSWORD}}
# DATABASE_URL: "sqlite:///tmp/data.db"
# with:
# base_image: raspios_lite_arm64:latest
# import_github_env: true
# commands: |
# apt-get update -y --allow-releaseinfo-change
# apt-get install --no-install-recommends -y libunwind-dev libgstreamer1.0-dev
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
# export PATH="$HOME/.cargo/bin:${PATH}"
# rustup -y target add aarch64-unknown-linux-gnu
# rustup -y toolchain install stable-aarch64-unknown-linux-gnu
# cargo binstall --no-confirm cargo-make cargo-insta sqlx-cli
# touch /tmp/data.db && cargo sqlx database reset --source ./hifirs/migrations -y
# cargo make ci-flow
51 changes: 23 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,35 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
rust: [stable]
exclude:
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-unknown-linux-gnu
env:
RUST_BACKTRACE: full
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-cache-${{ hashFiles('**/Cargo.lock') }}
shared-key: ${{ runner.os }}-rust-cache
- name: Build Web UI
uses: actions/setup-node@v3
with:
node-version: 18
- run: "npm install && npm run build"
working-directory: www
- name: Install gstreamer (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
- name: Install ${{ matrix.target }} packages (ubuntu-latest)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y libunwind-dev libgstreamer1.0-dev
- name: Install gstreamer (macos-latest)
- name: Install packages (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew install gstreamer
Expand All @@ -46,39 +54,26 @@ jobs:
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Install Cargo Plugins
run: cargo install cargo-make cargo-insta sqlx-cli
run: cargo install sqlx-cli
- name: Create db file
run: "touch /tmp/data.db && cd hifirs && cargo sqlx database reset -y"
env:
DATABASE_URL: "sqlite:///tmp/data.db"
- name: Build app
if: matrix.os == 'ubuntu-latest'
run: cargo build --bin hifi-rs --release --target x86_64-unknown-linux-gnu
- name: Build ${{ matrix.target }}
uses: actions-rs/cargo@v1
env:
SQLITE3_STATIC: true
PKG_CONFIG_ALL_STATIC: true
PKG_CONFIG_PATH_x86_64_unknown_linux_gnu: /usr/lib/x86_64-linux-gnu/pkgconfig
DATABASE_URL: "sqlite:///tmp/data.db"
- name: Tar app
if: matrix.os == 'ubuntu-latest'
run: tar -cvf hifi-rs-x86_64-unknown-linux-gnu.tar.gz -C ./target/x86_64-unknown-linux-gnu/release/ hifi-rs
- name: Release
if: matrix.os == 'ubuntu-latest'
uses: softprops/action-gh-release@v1
with:
files: hifi-rs-x86_64-unknown-linux-gnu.tar.gz
- name: Build app
if: matrix.os == 'macos-latest'
run: cargo build --bin hifi-rs --release --target x86_64-apple-darwin
env:
SQLITE3_STATIC: true
DATABASE_URL: "sqlite:///tmp/data.db"
- name: Tar app
if: matrix.os == 'macos-latest'
run: tar -cvf hifi-rs-x86_64-apple-darwin.tar.gz -C ./target/x86_64-apple-darwin/release hifi-rs
- name: Release
if: matrix.os == 'macos-latest'
command: build
args: --bin hifi-rs --release --target=${{ matrix.target }}
- name: Tar hifi-rs-${{ matrix.target }}.tar.gz
run: tar -cvf hifi-rs-${{ matrix.target }}.tar.gz -C ./target/${{ matrix.target }}/release/ hifi-rs
- name: Release ${{ matrix.target }}
uses: softprops/action-gh-release@v1
with:
files: hifi-rs-x86_64-apple-darwin.tar.gz
files: hifi-rs-${{ matrix.target }}.tar.gz
Loading