Skip to content

Commit

Permalink
add build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jan 17, 2024
1 parent 8aeac19 commit 331fc9b
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 58 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build

on:
pull_request:
push:
branches:
- main
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
matrix:
runs-on:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
fail-fast: false
runs-on: ${{ matrix.runs-on }}
steps:
- if: runner.os == 'Linux'
run: sudo apt install -y pkg-config libusb-1.0-0-dev libftdi1-dev libudev-dev
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo build --release
- if: runner.os == 'Linux' || runner.os == 'macOS'
run: chmod +x target/release/packetraven
- uses: vimtor/action-zip@v1.1
with:
files: target/release/packetraven${{ runner.os == 'Windows' && '.exe' || '' }}
dest: ${{ runner.os }}.zip
- uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}
path: target/release/packetraven${{ runner.os == 'Windows' && '.exe' || '' }}
- if: (github.event_name == 'release' && github.event.action == 'published')
uses: svenstaro/upload-release-action@v2
with:
file: ${{ runner.os }}.zip
52 changes: 13 additions & 39 deletions .github/workflows/tests.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: tests
name: test

on:
pull_request:
push:
branches:
- main
paths:
- '**.rs'
- '.github/workflows/tests.yml'
pull_request:
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -19,11 +13,13 @@ concurrency:
jobs:
test:
name: test (${{ matrix.runs-on }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
runs-on: ${{ matrix.runs-on }}
steps:
- if: runner.os == 'Linux'
run: sudo apt install -y pkg-config libusb-1.0-0-dev libftdi1-dev libudev-dev
Expand All @@ -32,11 +28,11 @@ jobs:
- run: cargo test
test_slow:
name: test slow (${{ matrix.runs-on }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-latest ]
runs-on:
- ubuntu-latest
runs-on: ${{ matrix.runs-on }}
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
steps:
Expand All @@ -49,9 +45,10 @@ jobs:
# name: test all features (${{ matrix.runs-on }})
# runs-on: ${{ matrix.runs-on }}
# strategy:
# fail-fast: false
# matrix:
# runs-on: [ ubuntu-latest ]
# runs-on:
# - ubuntu-latest
# fail-fast: false
# services:
# postgres:
# image: postgis/postgis:latest
Expand All @@ -75,26 +72,3 @@ jobs:
# - uses: actions/checkout@v3
# - uses: actions-rust-lang/setup-rust-toolchain@v1
# - run: cargo test
build:
needs: [ test, test_slow ]
if: (github.event_name == 'release' && github.event.action == 'published')
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
steps:
- if: runner.os == 'Linux'
run: sudo apt install -y pkg-config libusb-1.0-0-dev libftdi1-dev libudev-dev
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo build --release
- uses: actions/upload-artifact@v3
with:
name: packetraven-${{ runner.os }}
path: target/release/packetraven*
- uses: svenstaro/upload-release-action@v2
with:
asset_name: packetraven_${{ runner.os }}${{ runner.os == 'Windows' && '.exe' || '' }}
file: target/release/packetraven${{ runner.os == 'Windows' && '.exe' || '' }}

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "packetraven"
authors = ["Zach Burnett <zachary.r.burnett@gmail.com>"]
description = "track high-altitude balloon telemetry from a variety of sources"
version = "4.0.0"
version = "4.0.2"
edition = "2021"
readme = "README.md"
license = "GPL-3.0-or-later"
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,36 @@ The program is designed to be run during a flight and display information in a t

## Instructions

1. Follow [these instructions](https://packetraven.readthedocs.io/en/latest/configuration.html) to create a new configuration file in a text editor, or use the following example:
```yaml
# example.yaml
connections:
text:
- path: ~/raw_aprs_frames.txt
callsigns:
- W3EAX-8
- path: http://bpp.umd.edu/archives/Launches/NS-111_2022_07_31/APRS/W3EAX-8%20raw.txt
```
1. Follow [these instructions](https://packetraven.readthedocs.io/en/latest/configuration.html) to create a new configuration file in a text editor, or use the following simple example:
```yaml
# example.yaml
callsigns:
- W3EAX-8
connections:
sondehub: {}
text:
- path: http://bpp.umd.edu/archives/Launches/NS-111_2022_07_31/APRS/W3EAX-8%20raw.txt
- port: COM3
baud_rate: 9600
```

2. Download an executable from the [Releases page](https://github.com/UMDBPP/PacketRaven/releases).

3. Open a terminal window.

4. Run the executable you downloaded with the `start` subcommand, and give it the path to your configuration file:
```shell
packetraven_Windows.exe start example.yaml
```
```shell
packetraven.exe start example.yaml
```

> [!TIP]
> Add `--help` to any command to show usage instructions.
5. You should now see the user interface. Resize your terminal window or decrease the font size as needed.
![starting screen](https://github.com/UMDBPP/PacketRaven/blob/main/docs/images/example1_log.png)
![starting screen](https://github.com/UMDBPP/PacketRaven/blob/main/docs/images/example1_log.png)

6. The left and right arrow keys (or `Tab` and `Shift+Tab`) cycle through active tabs, and the up and down arrow keys change the current plot (or scroll through log messages).
![altitude telemetry plotted over time](https://github.com/UMDBPP/PacketRaven/blob/main/docs/images/example1_altitude.png)
![altitude telemetry plotted over time](https://github.com/UMDBPP/PacketRaven/blob/main/docs/images/example1_altitude.png)

7. To quit, press `q` or `Esc`.

Expand All @@ -58,7 +60,7 @@ The program is designed to be run during a flight and display information in a t
Use `predict` to retrieve a balloon flight prediction:

```shell
packetraven_Windows.exe predict "2023-08-16T10:00:00" -- -79 39 5 30000 9
packetraven.exe predict "2023-08-16T10:00:00" -- -79 39 5 30000 9
```

> [!WARNING]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use clap::Parser;
lazy_static::lazy_static! {
pub static ref DEFAULT_INTERVAL: chrono::Duration = chrono::Duration::seconds(60);
pub static ref DATETIME_FORMAT: String = "%Y-%m-%d %H:%M:%S".to_string();
pub static ref LOG_LEVEL: log::Level = log::Level::Debug;
pub static ref LOG_LEVEL: log::Level = log::Level::Info;
}

#[derive(Parser)]
Expand Down

0 comments on commit 331fc9b

Please sign in to comment.