Skip to content

Commit

Permalink
Add initial project files, CI/CD workflow, and utility scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
effective-range committed Jan 29, 2025
1 parent 8acb547 commit 5ebc661
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: CI/CD

on:
push:
branches: main
tags: v*.*.*

pull_request:
types:
- synchronize
- opened
- reopened

jobs:
call_ci:
uses: EffectiveRange/ci-workflows/.github/workflows/cmake-ci.yaml@v1
with:
build-arch: '["armhf","amd64","arm64"]'
run-sanitizers: false
run-coverage: false
secrets:
access-token: ${{secrets.ACTIONS_RO_TOKEN}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.22)

include(ERBuild NO_POLICY_SCOPE)


set(er-scripts-ver 1.0.0)

project(er-scripts VERSION ${er-scripts-ver} DESCRIPTION "This project contains various script utilities")

ER_DEPS()


install(FILES scripts/gstack DESTINATION /usr/local/bin/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ)
install(FILES scripts/logged DESTINATION /usr/local/bin/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ)
install(FILES scripts/record DESTINATION /usr/local/bin/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ)

# systemctl enable recog.service
# systemctl start recog.service
# install(FILES service/recog.service DESTINATION /etc/systemd/system)



ER_ENABLE_TEST()


# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/service/postinst;${CMAKE_CURRENT_SOURCE_DIR}/service/prerm")
ER_PACK()
6 changes: 6 additions & 0 deletions scripts/gstack
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <pid>"
exit 1
fi
gdb --quiet --pid $1 -iex "set pagination off" -iex "set print frame-arguments all" -iex "set print static off" -iex "print pretty on" -ex "thread apply all bt" -ex detach -ex quit
8 changes: 8 additions & 0 deletions scripts/logged
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
CURRDATE=$(date +%Y%m%d_%H%M%S.%N)
LOGDIR=/var/log/effective-range/shell
LOGFILE=$LOGDIR/logged_$CURRDATE.log
sudo mkdir -p $LOGDIR
echo "executing $@ at $CURRDATE" | sudo tee $LOGFILE
exec "$@" 2>&1 | sudo tee -a $LOGFILE

3 changes: 3 additions & 0 deletions scripts/record
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

arecord -D plughw:0 -c2 -r 48000 -f S32_LE -t wav -V stereo -v file_stereo_$(date +%s).wav

0 comments on commit 5ebc661

Please sign in to comment.