Skip to content

Commit

Permalink
Merge pull request #377 from thirtythreeforty/Fix-CI-Macos
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
thirtythreeforty authored Apr 14, 2024
2 parents 8c67766 + 0eddab0 commit 26fa7ee
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 37 deletions.
File renamed without changes.
24 changes: 18 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,27 @@ jobs:
- if: runner.os == 'Windows'
name: Install Gstreamer
run: |
choco install -y --no-progress gstreamer --version=1.16.2.20200527
choco install -y --no-progress gstreamer-devel --version=1.16.2
echo "Updating Cargo environment"
echo "C:\gstreamer\1.0\x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "GSTREAMER_1_0_ROOT_X86_64=C:\gstreamer\1.0\x86_64\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Gstreamer
choco install -y --no-progress gstreamer --version=1.20.0
choco install -y --no-progress gstreamer-devel --version=1.20.0
$env:GSTREAMER_1_0_ROOT_MSVC_X86_64=$env:SYSTEMDRIVE + '\gstreamer\1.0\msvc_x86_64\'
# Github runners work on both C or D drive and figuring out which was used is difficult
if (-not (Test-Path -Path "$env:GSTREAMER_1_0_ROOT_MSVC_X86_64" -PathType Container)) {
$env:GSTREAMER_1_0_ROOT_MSVC_X86_64='D:\\gstreamer\1.0\msvc_x86_64\'
}
echo "GSTREAMER_1_0_ROOT_MSVC_X86_64=$env:GSTREAMER_1_0_ROOT_MSVC_X86_64"
# Set github vars
Add-Content -Path $env:GITHUB_ENV -Value "GSTREAMER_1_0_ROOT_MSVC_X86_64=$env:GSTREAMER_1_0_ROOT_MSVC_X86_64"
Add-Content -Path $env:GITHUB_PATH -Value "$env:GSTREAMER_1_0_ROOT_MSVC_X86_64\bin"
Add-Content -Path $env:GITHUB_PATH -Value "%GSTREAMER_1_0_ROOT_MSVC_X86_64%\bin"
# One last check on directories
dir "$env:GSTREAMER_1_0_ROOT_MSVC_X86_64"
- if: runner.os == 'macOS'
name: Install Gstreamer on macOS
run: |
curl -L 'https://gstreamer.freedesktop.org/data/pkg/osx/1.16.2/gstreamer-1.0-devel-1.16.2-x86_64.pkg' -o "$(pwd)/gstreamer-devel.pkg"
curl -L 'https://gstreamer.freedesktop.org/data/pkg/osx/1.24.1/gstreamer-1.0-devel-1.24.1-universal.pkg' -o "$(pwd)/gstreamer-devel.pkg"
sudo installer -verbose -pkg "$(pwd)/gstreamer-devel.pkg" -target /
PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> "${GITHUB_ENV}"
Expand Down
59 changes: 30 additions & 29 deletions .github/workflows/style_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,49 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: apt install gstreamer
run: |
sudo apt update
sudo apt install -y libgstrtspserver-1.0-dev libgstreamer1.0-dev libgtk2.0-dev
- uses: actions-rs/toolchain@v1
with:
- uses: actions/checkout@v1
- name: apt install gstreamer
run: |
sudo apt-get update
sudo apt-get install -y aptitude
sudo aptitude install -y libgstrtspserver-1.0-dev libgstreamer1.0-dev libgtk2.0-dev
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- name: Run clippy action to produce annotations
uses: actions-rs/clippy-check@v1
if: steps.check_permissions.outputs.has-permission
with:
toolchain: nightly
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-targets --all-features
- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo +nightly clippy --workspace --all-targets --all-features
- name: Run clippy action to produce annotations
uses: actions-rs/clippy-check@v1
if: steps.check_permissions.outputs.has-permission
with:
toolchain: nightly
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-targets --all-features
- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo +nightly clippy --workspace --all-targets --all-features

check_fmt:
name: Rust-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
override: true
- name: rustfmt
run: |
cargo +nightly fmt --all -- --check
- name: rustfmt
run: |
cargo +nightly fmt --all -- --check
check_lua:
name: Luacheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run luacheck
uses: nebularg/actions-luacheck@v1
with:
files: 'dissector/baichuan.lua'
args: --globals Dissector Proto ProtoField base ByteArray DESEGMENT_ONE_MORE_SEGMENT DissectorTable
- uses: actions/checkout@v1
- name: Run luacheck
uses: nebularg/actions-luacheck@v1
with:
files: "dissector/baichuan.lua"
args: --globals Dissector Proto ProtoField base ByteArray DESEGMENT_ONE_MORE_SEGMENT DissectorTable
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@

# Committing IntelliJ project files is a violation of intergalactic law
.idea/

.vscode/
.pre-commit-config.yaml
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ fn github_ver() -> Option<String> {
fn platform_cfg() {
let gstreamer_dir = env::var_os("GSTREAMER_1_0_ROOT_X86_64")
.and_then(|x| x.into_string().ok())
.unwrap_or_else(|| r#"C:\gstreamer\1.0\x86_64\"#.to_string());
.unwrap_or_else(|| {
env::var_os("GSTREAMER_1_0_ROOT_MSVC_X86_64")
.and_then(|x| x.into_string().ok())
.unwrap_or_else(|| r#"C:\gstreamer\1.0\x86_64\"#.to_string())
});

println!(r"cargo:rustc-link-search=native={}\lib", gstreamer_dir);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/bc_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use bc::model::*;
pub(crate) use connection::*;
pub use errors::Error;
pub use ledstate::LightState;
pub use motion::{MotionOutput, MotionOutputError, MotionStatus};
pub use pirstate::PirState;
pub use resolution::*;
pub use motion::{MotionOutput, MotionOutputError, MotionStatus};
pub use stream::{Stream, StreamOutput, StreamOutputError};

type Result<T> = std::result::Result<T, Error>;
Expand Down

0 comments on commit 26fa7ee

Please sign in to comment.