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.
|
Hot deals on the command line.
|
||||||
|
|
||||||
[](https://travis-ci.com/davegallant/rfd)
|
|
||||||
[](https://badge.fury.io/py/rfd)
|
[](https://badge.fury.io/py/rfd)
|
||||||
[](https://dependabot.com/)
|
[](https://dependabot.com/)
|
||||||
[](https://pepy.tech/project/rfd)
|
[](https://pepy.tech/project/rfd)
|
||||||
@@ -17,7 +16,7 @@ pip install rfd
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
Usage: rfd [OPTIONS] COMMAND [ARGS]...
|
Usage: rfd [OPTIONS] COMMAND [ARGS]...
|
||||||
|
|
||||||
CLI for https://forums.redflagdeals.com
|
CLI for https://forums.redflagdeals.com
|
||||||
@@ -34,60 +33,62 @@ Commands:
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
All commands open up in a pager.
|
All commands open up in a [terminal pager](https://en.wikipedia.org/wiki/Terminal_pager).
|
||||||
|
|
||||||
Search can be done using `/`.
|
|
||||||
|
|
||||||
Close pager with `q`.
|
|
||||||
|
|
||||||
### View Hot Deals
|
### View Hot Deals
|
||||||
|
|
||||||
```console
|
```sh
|
||||||
$ rfd threads
|
rfd threads
|
||||||
```
|
```
|
||||||
|
|
||||||
### View and Sort Hot Deals
|
### View and Sort Hot Deals
|
||||||
|
|
||||||
```console
|
```sh
|
||||||
$ rfd threads --sort-by score
|
rfd threads --sort-by score
|
||||||
```
|
```
|
||||||
|
|
||||||
```console
|
To view and sort multiple pages, use `--pages`:
|
||||||
$ rfd threads --sort-by views --pages 10
|
|
||||||
|
```sh
|
||||||
|
rfd threads --sort-by views --pages 10
|
||||||
```
|
```
|
||||||
|
|
||||||
### Simple Search
|
### Simple Search
|
||||||
|
|
||||||
```console
|
```sh
|
||||||
$ rfd search 'pizza'
|
rfd search 'pizza'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Advanced Search
|
### Advanced Search
|
||||||
|
|
||||||
Regular expressions can be used for search.
|
Regular expressions can be used for search.
|
||||||
|
|
||||||
```console
|
```sh
|
||||||
$ rfd search '(coffee|starbucks)' --pages 10 --sort-by views
|
rfd search '(coffee|starbucks)' --pages 10 --sort-by views
|
||||||
```
|
```
|
||||||
|
|
||||||
### View Posts
|
### View Posts
|
||||||
|
|
||||||
```console
|
It's possible to view an entire post and all comments by running:
|
||||||
$ rfd posts https://forums.redflagdeals.com/kobo-vs-kindle-2396227/
|
|
||||||
|
```sh
|
||||||
|
rfd posts https://forums.redflagdeals.com/kobo-vs-kindle-2396227/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This allows for easy grepping and searching for desired expressions.
|
||||||
|
|
||||||
## Shell Completion
|
## Shell Completion
|
||||||
|
|
||||||
Completion can be enabled if using `bash` or `zsh`.
|
Shell completion can be enabled if using `bash` or `zsh`.
|
||||||
|
|
||||||
### bash
|
### bash
|
||||||
|
|
||||||
```console
|
```sh
|
||||||
$ echo 'eval "$(_RFD_COMPLETE=source rfd)"' >> ~/.profile
|
echo 'eval "$(_RFD_COMPLETE=source rfd)"' >> ~/.profile
|
||||||
```
|
```
|
||||||
|
|
||||||
### zsh
|
### zsh
|
||||||
|
|
||||||
```console
|
```sh
|
||||||
$ echo 'eval "$(_RFD_COMPLETE=source_zsh rfd)"' >> ~/.zshrc
|
echo 'eval "$(_RFD_COMPLETE=source_zsh rfd)"' >> ~/.zshrc
|
||||||
```
|
```
|
||||||
|
@@ -6,7 +6,7 @@ def run_cli(args):
|
|||||||
cmd = ["python", "-m", "rfd"] + args.split()
|
cmd = ["python", "-m", "rfd"] + args.split()
|
||||||
p = Popen(cmd, stdout=PIPE)
|
p = Popen(cmd, stdout=PIPE)
|
||||||
stdout, _ = p.communicate()
|
stdout, _ = p.communicate()
|
||||||
assert p.returncode == 0
|
assert p.returncode == 0, stdout
|
||||||
return stdout
|
return stdout
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user