-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into support-conf-file
- Loading branch information
Showing
154 changed files
with
8,981 additions
and
21,044 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,15 @@ | ||
codecov: | ||
notify: | ||
require_ci_to_pass: no | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "70...100" | ||
status: | ||
project: | ||
default: | ||
target: auto | ||
threshold: 1% | ||
base: auto | ||
patch: off |
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
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
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,133 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.10' ] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Configure git | ||
run: | | ||
git config --global user.name 'travis-ci' | ||
git config --global user.email 'travis@nowhere.edu' | ||
- name: Filter changed file paths to outputs | ||
uses: dorny/paths-filter@v2.7.0 | ||
id: changes | ||
with: | ||
filters: | | ||
root_docs: | ||
- CHANGES | ||
- README.* | ||
docs: | ||
- 'docs/**/*.rst' | ||
- 'docs/**/*.md' | ||
- 'examples/**' | ||
python_files: | ||
- 'tmuxp/**' | ||
- name: Should publish | ||
if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true' | ||
run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get full Python version | ||
id: full-python-version | ||
if: env.PUBLISH == 'true' | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Install poetry | ||
if: env.PUBLISH == 'true' | ||
run: | | ||
curl -O -sSL https://install.python-poetry.org/install-poetry.py | ||
python install-poetry.py -y --version 1.1.12 | ||
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV | ||
rm install-poetry.py | ||
- name: Add ~/.local/bin to PATH | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Get poetry cache paths from config | ||
if: env.PUBLISH == 'true' | ||
run: | | ||
echo "poetry_cache_dir=$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV | ||
echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV | ||
- name: Configure poetry | ||
if: env.PUBLISH == 'true' | ||
shell: bash | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: | | ||
.venv | ||
{{ env.poetry_cache_dir }} | ||
{{ env.poetry_virtualenvs_path }} | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Ensure cache is healthy | ||
if: steps.cache.outputs.cache-hit == 'true' && env.PUBLISH == 'true' | ||
shell: bash | ||
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv | ||
|
||
- name: Upgrade pip | ||
shell: bash | ||
if: env.PUBLISH == 'true' | ||
run: poetry run python -m pip install pip -U | ||
|
||
- name: Install dependencies [w/ docs] | ||
if: env.PUBLISH == 'true' | ||
run: poetry install --extras "docs lint" | ||
|
||
- name: Build documentation | ||
if: env.PUBLISH == 'true' | ||
run: | | ||
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd | ||
- name: Push documentation to S3 | ||
if: env.PUBLISH == 'true' | ||
uses: jakejarvis/s3-sync-action@master | ||
with: | ||
args: --acl public-read --follow-symlinks --delete | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1 | ||
SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository | ||
|
||
- name: Generate list of changed files for CloudFront to invalidate | ||
if: env.PUBLISH == 'true' | ||
run: | | ||
pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd | ||
for file in $FILES; do | ||
echo $file | ||
# add bare directory to list of updated paths when we see index.html | ||
[[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//' | ||
done | sort | uniq | tr '\n' ' ' > .updated_files | ||
- name: Invalidate on CloudFront | ||
uses: chetan/invalidate-cloudfront-action@master | ||
if: env.PUBLISH == 'true' | ||
env: | ||
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }} | ||
AWS_REGION: 'us-east-1' | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
PATHS_FROM: .updated_files |
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,103 @@ | ||
name: tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
# Don't run twice for internal PRs from our own repo | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.10' ] | ||
tmux-version: [ '2.6', '2.7', '2.8', '3.0a', '3.1b', '3.2a', 'master' ] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get full Python version | ||
id: full-python-version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Install poetry | ||
run: | | ||
curl -O -sSL https://install.python-poetry.org/install-poetry.py | ||
python install-poetry.py -y --version 1.1.12 | ||
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV | ||
rm install-poetry.py | ||
- name: Add ~/.local/bin to PATH | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Get poetry cache paths from config | ||
run: | | ||
echo "poetry_cache_dir=$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV | ||
echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV | ||
- name: Configure poetry | ||
shell: bash | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Set up poetry cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: | | ||
.venv | ||
${{ env.poetry_cache_dir }} | ||
${{ env.poetry_virtualenvs_path }} | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Ensure cache is healthy | ||
if: steps.cache.outputs.cache-hit == 'true' | ||
shell: bash | ||
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv | ||
|
||
- name: Setup tmux build cache for tmux ${{ matrix.tmux-version }} | ||
id: tmux-build-cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/tmux-builds/tmux-${{ matrix.tmux-version }} | ||
key: tmux-${{ matrix.tmux-version }} | ||
|
||
- name: Build tmux ${{ matrix.tmux-version }} | ||
if: steps.tmux-build-cache.outputs.cache-hit != 'true' | ||
run: | | ||
sudo apt install libevent-dev libncurses5-dev libtinfo-dev libutempter-dev bison | ||
mkdir ~/tmux-builds | ||
mkdir ~/tmux-src | ||
git clone https://github.com/tmux/tmux.git ~/tmux-src/tmux-${{ matrix.tmux-version }} | ||
cd ~/tmux-src/tmux-${{ matrix.tmux-version }} | ||
git checkout ${{ matrix.tmux-version }} | ||
sh autogen.sh | ||
./configure --prefix=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }} && make && make install | ||
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH | ||
cd ~ | ||
tmux -V | ||
- name: Upgrade pip | ||
shell: bash | ||
run: poetry run python -m pip install pip -U | ||
|
||
- name: Install python dependencies | ||
run: | | ||
poetry install -E "test coverage lint" | ||
- name: Lint with flake8 | ||
run: | | ||
poetry run flake8 | ||
- name: Test with pytest | ||
continue-on-error: ${{ matrix.tmux-version == 'master' }} | ||
run: | | ||
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH | ||
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin | ||
tmux -V | ||
poetry run py.test --cov=./ --cov-report=xml | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ htmlcov/ | |
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.1.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.10 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 |
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,3 @@ | ||
#!/bin/sh | ||
poetry shell --no-ansi --no-interaction &2> /dev/null | ||
poetry install --no-ansi --no-interaction &2> /dev/null |
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,41 +1,41 @@ | ||
{ | ||
"before_script": "pipenv install --dev --skip-lock", | ||
"session_name": "tmuxp", | ||
"start_directory": "./", | ||
"before_script": "./.tmuxp-before-script.sh", | ||
"shell_command_before": [ | ||
"[ -f .venv/bin/activate ] && source .venv/bin/activate && reset" | ||
], | ||
"windows": [ | ||
{ | ||
"window_name": "tmuxp", | ||
"focus": true, | ||
"layout": "main-horizontal", | ||
"options": { | ||
"main-pane-height": 35 | ||
}, | ||
"panes": [ | ||
{ | ||
"focus": true | ||
}, | ||
"pane", | ||
}, | ||
"pane", | ||
"make watch_test" | ||
], | ||
"layout": "main-horizontal", | ||
] | ||
}, | ||
{ | ||
"window_name": "docs", | ||
"layout": "main-horizontal", | ||
"options": { | ||
"main-pane-height": 35 | ||
}, | ||
"focus": true, | ||
"window_name": "tmuxp" | ||
}, | ||
{ | ||
}, | ||
"start_directory": "docs/", | ||
"panes": [ | ||
{ | ||
"focus": true | ||
}, | ||
"pane", | ||
"make serve", | ||
"make watch" | ||
], | ||
"start_directory": "doc/", | ||
"layout": "main-horizontal", | ||
"window_name": "docs", | ||
"options": { | ||
"main-pane-height": 35 | ||
} | ||
}, | ||
"pane", | ||
"make serve", | ||
"make SPHINXBUILD='poetry run sphinx-build' watch" | ||
] | ||
} | ||
], | ||
"session_name": "tmuxp", | ||
"start_directory": "./", | ||
"shell_command_before": [ | ||
"[ -d `pipenv --venv` ] && source `pipenv --venv`/bin/activate && reset" | ||
] | ||
} | ||
} |
Oops, something went wrong.