ci: copy basic CI from bec log ingestor
Test and Coverage / Test (push) Successful in 20s
Check and Lint / Check (pull_request) Successful in 19s
Check and Lint / Rustfmt (pull_request) Failing after 16s
Check and Lint / Clippy (pull_request) Successful in 19s
Test and Coverage / Test (pull_request) Successful in 42s
Test and Coverage / Coverage (push) Successful in 3m22s
Check and Lint / Build RPM (pull_request) Failing after 3m38s
Test and Coverage / Coverage (pull_request) Successful in 4m26s

This commit is contained in:
2026-07-07 15:39:27 +02:00
parent 2c98dd1c80
commit fd317d51c1
6 changed files with 161 additions and 2 deletions
+56
View File
@@ -0,0 +1,56 @@
name: Check and Lint
on:
pull_request:
push:
branches:
- main
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- run: cargo check --all-targets
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: https://github.com/Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features -- -D warnings
build-rpm:
name: Build RPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- name: Build RPM
run: |
cargo build --release
strip -s target/release/aarel
cargo install cargo-generate-rpm
cargo generate-rpm
- uses: https://github.com/actions/upload-artifact@v3
with:
name: rpm
path: target/generate-rpm/*.rpm
+39
View File
@@ -0,0 +1,39 @@
name: Release
on:
push:
tags:
- "v*"
env:
RUST_BACKTRACE: 1
jobs:
build-rpm:
name: Build and push RPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- name: Build RPM
run: |
cargo build --release
strip -s target/release/aarel
cargo install cargo-generate-rpm
cargo generate-rpm
- uses: actions/upload-artifact@v3
with:
name: rpm
path: target/generate-rpm/*.rpm
- name: Push to Gitea RPM registry
run: |
for pkg in target/generate-rpm/*.rpm; do
curl -f -X PUT \
--user "${{ secrets.GITEA_REGISTRY_TOKEN }}" \
--upload-file "$pkg" \
"https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/upload"
done
+29
View File
@@ -0,0 +1,29 @@
name: Test and Coverage
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- run: cargo test --all-features
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: https://github.com/dtolnay/rust-toolchain@stable
- uses: https://github.com/Swatinem/rust-cache@v2
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Generate code coverage
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
- uses: https://github.com/actions/upload-artifact@v3
with:
name: coverage
path: cobertura.xml
+17
View File
@@ -1,8 +1,25 @@
[package]
name = "aare_launcher"
description = "Launcher for AareDAQ applications on MX beamline consoles at PSI"
readme = "README.md"
repository = "https://gitea.psi.ch/perl_d/aare_launcher"
keywords = ["mx", "beamline", "launcher", "tui"]
categories = ["science", "command-line-utilities"]
license = "GPL-3.0-only"
version = "0.1.0"
edition = "2024"
# The installed command is `aarel`.
[[bin]]
name = "aarel"
path = "src/main.rs"
[package.metadata.generate-rpm]
assets = [
{ source = "target/release/aarel", dest = "/usr/local/bin/aarel", mode = "755" },
{ source = "data/defaults.json", dest = "/etc/aarel/defaults.json", mode = "644", config = true },
]
[dependencies]
anyhow = "1.0.103"
clap = { version = "4.6.1", features = ["derive"] }
+19 -1
View File
@@ -1,3 +1,21 @@
# aare_launcher
cli/tui launcher for aare daq+gui
[![Check and Lint](https://gitea.psi.ch/perl_d/aare_launcher/actions/workflows/check-and-lint.yaml/badge.svg)](https://gitea.psi.ch/perl_d/aare_launcher/actions?workflow=check-and-lint.yaml)
[![Test and Coverage](https://gitea.psi.ch/perl_d/aare_launcher/actions/workflows/test-and-coverage.yaml/badge.svg)](https://gitea.psi.ch/perl_d/aare_launcher/actions?workflow=test-and-coverage.yaml)
[![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-blue.svg)](LICENSE)
CLI/TUI launcher for the AareDAQ server and GUI on MX beamline consoles at PSI.
Installed as the `aarel` command. It detects the current beamline and launches the
matching application, or opens a TUI to pick one.
## Usage
```
aarel pick # open the TUI to choose what to launch
aarel gui # launch the GUI for the detected beamline
aarel server # launch the server for the detected beamline
```
Use `--entry <beamline>` with `gui`/`server` to override detection, and `--config
<path>` to use a different config file.
+1 -1
View File
@@ -11,7 +11,7 @@ use config::{Config, LauncherEntry, load_config};
use detect::detect_beamline;
#[derive(Parser)]
#[command(name = "aare_launcher")]
#[command(name = "aarel")]
struct Cli {
/// Path to the launcher config file.
#[arg(long, default_value = "data/defaults.json")]