-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp scripts, different caching system
* Improve caching method, now using `sqlite3` * No [id | title] in rofi results, only title * Lint scripts using `shellcheck` * Add github actions on push and pr * Remove `argparse.sh` dep (and so `python`) * Fix/improve `Makefile` * General fixes
- Loading branch information
Andrea Rossoni
committed
Jul 27, 2021
1 parent
5456fed
commit a513707
Showing
7 changed files
with
836 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# | ||
# LINT.YML | ||
# | ||
# This workflow will run: | ||
# | ||
# * `changes` | ||
# * check what files have been changes | ||
# | ||
# * `lint` | ||
# * install deps | ||
# * make install | ||
# * shellcheck scripts | ||
# * simple run scripts | ||
# | ||
|
||
--- | ||
name: Lint CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
changes: | ||
name: Check changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
files: ${{ steps.filter.outputs.files }} | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
|
||
- name: Filter paths | ||
uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
files: | ||
- 'bin/**' | ||
- 'Makefile' | ||
lint: | ||
name: Shell check | ||
runs-on: ubuntu-latest | ||
needs: [ changes ] | ||
if: ${{ needs.changes.outputs.files == 'true' }} | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install deps | ||
run: | | ||
sudo apt update | ||
sudo apt install mpv rofi | ||
python -m pip install youtube-dl | ||
- name: Setup some envs | ||
run: | | ||
echo "HOME=$HOME" >> $GITHUB_ENV | ||
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV | ||
- name: Shellcheck scripts | ||
run: | | ||
shellcheck -s bash bin/mpvctl | ||
shellcheck -s bash bin/ytdl-mpv | ||
- name: Make install | ||
run: make | ||
|
||
- name: Run mpvctl help | ||
run: mpvctl --help | ||
|
||
- name: Run ytdl-mpv help | ||
run: ytdl-mpv --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
ignore: | | ||
/.tox/ | ||
/.venv/ | ||
/.github/ | ||
|
||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
truthy: | ||
allowed-values: ["yes", "no", "true", "false", "True", "False"] | ||
level: error | ||
# Disabled rules | ||
document-start: disable | ||
indentation: disable | ||
line-length: disable | ||
colons: disable | ||
empty-lines: disable | ||
comments: disable | ||
comments-indentation: disable | ||
trailing-spaces: disable | ||
new-line-at-end-of-file: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
|
||
# Makefile | ||
# -------- | ||
# To specify another prefix run | ||
# $ PREFIX=/another/prefix make | ||
|
||
PREFIX ?= ~/.local | ||
|
||
install: | ||
@echo "Copy bin into $(PREFIX)" | ||
@install -Dm755 mpvctl $(PREFIX)/bin/mpvctl | ||
@install -Dm755 ytdl-mpv $(PREFIX)/bin/ytdl-mpv | ||
@echo "Install bin into $(PREFIX)" | ||
@install -Dm755 bin/mpvctl $(PREFIX)/bin/mpvctl | ||
@install -Dm755 bin/ytdl-mpv $(PREFIX)/bin/ytdl-mpv | ||
uninstall: | ||
@echo "Remove bin from $(PREFIX)" | ||
@rm -i $(PREFIX)/bin/mpvctl | ||
@rm -i ytdl-mpv $(PREFIX)/bin/ytdl-mpv | ||
@rm -i $(PREFIX)/bin/ytdl-mpv | ||
|
||
.PHONY: install uninstall |
Oops, something went wrong.