Skip to content

Commit

Permalink
tests: separate test workflow for main and PRs
Browse files Browse the repository at this point in the history
* add test badge for main to README.md
  • Loading branch information
xx4h committed Oct 14, 2024
1 parent 0310999 commit d42e0c2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
name: Tests
name: Test Code Base

on:
workflow_dispatch:
push:
branches: main
pull_request:
branches: main

permissions: {}

jobs:
build:
name: Tests
name: Test Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Test Pull Request

on:
pull_request:
branches: main

permissions: {}

jobs:
build:
name: Test Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed
# files within `super-linter`
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5

- name: Go Build
run: CGO_ENABLED=0 go build -v -trimpath -ldflags '-w -s' ./main.go

- name: Go test
uses: robherley/go-test-action@v0
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<!-- markdownlint-disable no-empty-links -->

[![Lint Code Base](https://github.com/xx4h/hctl/actions/workflows/linter-full.yml/badge.svg)](https://github.com/xx4h/hctl/actions/workflows/linter-full.yml)
[![Test Code Base](https://github.com/xx4h/hctl/actions/workflows/test-full.yml/badge.svg)](https://github.com/xx4h/hctl/actions/workflows/test-full.yml)
[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/xx4h/hctl/total)](https://github.com/xx4h/hctl/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/xx4h/hctl?)](https://goreportcard.com/report/github.com/xx4h/hctl)
[![codebeat badge](https://codebeat.co/badges/21ee1b92-b94c-4425-a600-b01dd4b1c045)](https://codebeat.co/projects/github-com-xx4h-hctl-main)
Expand All @@ -31,14 +32,14 @@ And here we are!

<p align="center"><img alt="hctl showcase demo" src="/assets/demo.gif?raw=true"/></p>

- Support for Home Assistant
- Turn on/off, or toggle all capable devices
- Play local and remote music files
- Set volume on media players
- List all Domains & Domain-Services
- Completion for `bash`, `zsh`, `fish` and `powershell`, auto completing all capable devices
- Control over short and long names
- Fuzzy matching your devices so you can keep it short
- Support for Home Assistant
- Turn on/off, or toggle all capable devices
- Play local and remote music files
- Set volume on media players
- List all Domains & Domain-Services
- Completion for `bash`, `zsh`, `fish` and `powershell`, auto completing all capable devices
- Control over short and long names
- Fuzzy matching your devices so you can keep it short

## Install

Expand Down Expand Up @@ -86,9 +87,9 @@ Copy the example config from this project
```yaml
# Configure Hub
hub:
type: hass
url: https://home-assistant.example.com/api
token: YourToken
type: hass
url: https://home-assistant.example.com/api
token: YourToken
```
ensure the folder does already exist and edit with your favorite editor
Expand Down Expand Up @@ -161,7 +162,7 @@ Completion Short Names can be disabled with:

```yaml
completion:
short_names: false
short_names: false
```
### Fuzzy Matching
Expand All @@ -182,14 +183,14 @@ Fuzzy Matching can be turned off in the config with:

```yaml
handling:
fuzz: false
fuzz: false
```
## What's Next / Roadmap
- [ ] Add more actions (like `press` e.g. Buttons, `trigger` e.g. Automations, or `lock` and `unlock` a Lock)
- [ ] Add output/feedback on actions (e.g. use pterm)
- [ ] Allow multiple devices on actions
- [ ] Add optional positional for `list entities`, following the same logic as in `toggle`, `on` and `off` (e.g. matching short names and fuzzy matching)
- [ ] Add possibility to add local mappings for devices in config
- [ ] Add install methods (native, asdf, ...)
- [ ] Add more actions (like `press` e.g. Buttons, `trigger` e.g. Automations, or `lock` and `unlock` a Lock)
- [ ] Add output/feedback on actions (e.g. use pterm)
- [ ] Allow multiple devices on actions
- [ ] Add optional positional for `list entities`, following the same logic as in `toggle`, `on` and `off` (e.g. matching short names and fuzzy matching)
- [ ] Add possibility to add local mappings for devices in config
- [ ] Add install methods (native, asdf, ...)

0 comments on commit d42e0c2

Please sign in to comment.