Skip to content

Commit 7075c68

Browse files
committed
build: Add gh action for testing (ported via libtmux)
1 parent e5ec2d8 commit 7075c68

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/tests.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [ '3.x' ]
12+
tmux-version: [ '2.6', '2.7', '2.8', '3.0', 'master' ]
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Cache tmux build ${{ matrix.tmux-version }}
16+
id: tmux-build-cache
17+
uses: actions/cache@v1
18+
with:
19+
path: ~/tmux-builds/tmux-${{ matrix.tmux-version }}
20+
key: tmux-${{ matrix.tmux-version }}
21+
22+
- name: Build tmux ${{ matrix.tmux-version }}
23+
if: steps.tmux-build-cache.outputs.cache-hit != 'true'
24+
run: |
25+
sudo apt install libevent-dev libncurses5-dev libtinfo-dev libutempter-dev bison
26+
mkdir ~/tmux-builds
27+
mkdir ~/tmux-src
28+
git clone https://github.com/tmux/tmux.git ~/tmux-src/tmux-${{ matrix.tmux-version }}
29+
cd ~/tmux-src/tmux-${{ matrix.tmux-version }}
30+
git checkout ${{ matrix.tmux-version }}
31+
sh autogen.sh
32+
./configure --prefix=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }} && make && make install
33+
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
34+
cd ~
35+
tmux -V
36+
- name: Configure git
37+
run: |
38+
git config --global user.name 'travis-ci'
39+
git config --global user.email '[email protected]'
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v1
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
- name: Install python dependencies
45+
run: |
46+
python -m pip install --upgrade poetry
47+
poetry install
48+
- name: Lint with flake8
49+
run: |
50+
poetry run flake8
51+
- name: Test with pytest
52+
continue-on-error: ${{ matrix.tmux-version == 'master' }}
53+
run: |
54+
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
55+
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin
56+
tmux -V
57+
poetry run py.test --cov=./ --cov-report=xml
58+
- uses: codecov/codecov-action@v1
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)