mirror of
https://github.com/davegallant/rfd.git
synced 2025-08-05 16:23:40 +00:00
Run tests in GitHub Actions instead of Travis-CI (#89)
* Replace travis-ci with Actions * Update README.md * Add stdout to assertion failure
This commit is contained in:
25
.github/workflows/tests.yml
vendored
Normal file
25
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Tests
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8, 3.9]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install .
|
||||
pip install -r requirements_dev.txt
|
||||
- name: Run pre-commit
|
||||
run: |
|
||||
git diff --name-only $TRAVIS_COMMIT_RANGE | xargs pre-commit run --files
|
||||
- name: Test
|
||||
run: make ci
|
36
.travis.yml
36
.travis.yml
@@ -1,36 +0,0 @@
|
||||
language: python
|
||||
dist: bionic
|
||||
sudo: false
|
||||
cache: false
|
||||
stages:
|
||||
- name: deploy
|
||||
if: repo = davegallant/rfd AND tag IS present
|
||||
|
||||
before_install:
|
||||
- pip install -U pip
|
||||
install:
|
||||
- python setup.py install
|
||||
- pip install -r requirements_dev.txt
|
||||
- git diff --name-only $TRAVIS_COMMIT_RANGE | xargs pre-commit run --files
|
||||
script:
|
||||
- tox
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- python: "2.7"
|
||||
- python: "3.5"
|
||||
- python: "3.6"
|
||||
- python: "3.7"
|
||||
- python: "3.8"
|
||||
- python: "3.9-dev"
|
||||
|
||||
- stage: deploy
|
||||
python: "3.8"
|
||||
deploy:
|
||||
on:
|
||||
repo: davegallant/rfd
|
||||
tags: true
|
||||
provider: pypi
|
||||
user: __token__
|
||||
password:
|
||||
secure: qxOUGvwMz+ZfkDeizevNoMGDWSxkyhQLb6xmjjxcv6ZiZo7u3c7IbPD5rKD8fayWZ+7uLplc7BNBce4DDYgtLcxQEq2NpFWZ+hQSXN98luMdR532axoaa4N4UaLW6rhm+lfgiQljv27vnc2Ce6xYcIwLdpmoGBRnEV4+EmDdhLTwV9wJwkfpMtffV0Lsx8R8uAOfm3y71/urmJWszH2xVxAyOWP+hkSvccyiN6v2KiPQ428f/iqHlusz1ChKanKlFo141CsUAZc5sHRDy8QJmb2VpPUU75whnkGJONj1/hOuWlInzeH+mXYsT7YieM2SgkXdShdKMuyJz081Nsvy0jufMY1v1D/WwGLlhsYgrx/Q3W3ivvzSPn0TbE4FHexh0N4JoZ7K/fBNS0lQ9aLaV7nwEJKYcs5UY8hBywOIEpImkM79tdDiuGJyQ+ulwvZHLvfMy/LXi06DzHFFMz0skGNXT/b+8/IjeU47dSxSvfls7sgO8OKvWnecIeXfXQ9nUIP4aCjaE3G9nsdBzRNgaASZkCiReWIgA13Dbb7Sqb7fKRaAI+j7PZw5j7s8kT5zfdTDYGCAnGyFkDR+L4EXM5/0UDTIjpUgLTxOPxkl4REin5V4ojJC87h0bUONhzNG5odGpZ45kZMUpuhJgLtQ42hvOxZ6B6I2Ln8ZeHIN59w=
|
49
README.md
49
README.md
@@ -2,7 +2,6 @@
|
||||
|
||||
Hot deals on the command line.
|
||||
|
||||
[](https://travis-ci.com/davegallant/rfd)
|
||||
[](https://badge.fury.io/py/rfd)
|
||||
[](https://dependabot.com/)
|
||||
[](https://pepy.tech/project/rfd)
|
||||
@@ -17,7 +16,7 @@ pip install rfd
|
||||
|
||||
## Usage
|
||||
|
||||
```shell
|
||||
```sh
|
||||
Usage: rfd [OPTIONS] COMMAND [ARGS]...
|
||||
|
||||
CLI for https://forums.redflagdeals.com
|
||||
@@ -34,60 +33,62 @@ Commands:
|
||||
|
||||
## Examples
|
||||
|
||||
All commands open up in a pager.
|
||||
|
||||
Search can be done using `/`.
|
||||
|
||||
Close pager with `q`.
|
||||
All commands open up in a [terminal pager](https://en.wikipedia.org/wiki/Terminal_pager).
|
||||
|
||||
### View Hot Deals
|
||||
|
||||
```console
|
||||
$ rfd threads
|
||||
```sh
|
||||
rfd threads
|
||||
```
|
||||
|
||||
### View and Sort Hot Deals
|
||||
|
||||
```console
|
||||
$ rfd threads --sort-by score
|
||||
```sh
|
||||
rfd threads --sort-by score
|
||||
```
|
||||
|
||||
```console
|
||||
$ rfd threads --sort-by views --pages 10
|
||||
To view and sort multiple pages, use `--pages`:
|
||||
|
||||
```sh
|
||||
rfd threads --sort-by views --pages 10
|
||||
```
|
||||
|
||||
### Simple Search
|
||||
|
||||
```console
|
||||
$ rfd search 'pizza'
|
||||
```sh
|
||||
rfd search 'pizza'
|
||||
```
|
||||
|
||||
### Advanced Search
|
||||
|
||||
Regular expressions can be used for search.
|
||||
|
||||
```console
|
||||
$ rfd search '(coffee|starbucks)' --pages 10 --sort-by views
|
||||
```sh
|
||||
rfd search '(coffee|starbucks)' --pages 10 --sort-by views
|
||||
```
|
||||
|
||||
### View Posts
|
||||
|
||||
```console
|
||||
$ rfd posts https://forums.redflagdeals.com/kobo-vs-kindle-2396227/
|
||||
It's possible to view an entire post and all comments by running:
|
||||
|
||||
```sh
|
||||
rfd posts https://forums.redflagdeals.com/kobo-vs-kindle-2396227/
|
||||
```
|
||||
|
||||
This allows for easy grepping and searching for desired expressions.
|
||||
|
||||
## Shell Completion
|
||||
|
||||
Completion can be enabled if using `bash` or `zsh`.
|
||||
Shell completion can be enabled if using `bash` or `zsh`.
|
||||
|
||||
### bash
|
||||
|
||||
```console
|
||||
$ echo 'eval "$(_RFD_COMPLETE=source rfd)"' >> ~/.profile
|
||||
```sh
|
||||
echo 'eval "$(_RFD_COMPLETE=source rfd)"' >> ~/.profile
|
||||
```
|
||||
|
||||
### zsh
|
||||
|
||||
```console
|
||||
$ echo 'eval "$(_RFD_COMPLETE=source_zsh rfd)"' >> ~/.zshrc
|
||||
```sh
|
||||
echo 'eval "$(_RFD_COMPLETE=source_zsh rfd)"' >> ~/.zshrc
|
||||
```
|
||||
|
@@ -6,7 +6,7 @@ def run_cli(args):
|
||||
cmd = ["python", "-m", "rfd"] + args.split()
|
||||
p = Popen(cmd, stdout=PIPE)
|
||||
stdout, _ = p.communicate()
|
||||
assert p.returncode == 0
|
||||
assert p.returncode == 0, stdout
|
||||
return stdout
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user