ci: Setup GitHub Actions to run unit tests

This commit is contained in:
2019-11-29 03:07:17 +00:00
parent 6e2e24e0f2
commit 9b10b52801
2 changed files with 43 additions and 0 deletions

34
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: CI
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
tmux_version:
- "2.6"
- "2.7"
- "2.8"
- "2.9a"
- "3.0a"
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out the code
uses: actions/checkout@v1
- name: Install Tmux ${{ matrix.tmux_version }}
run: |
sudo apt-get update
sudo apt-get install -y bc build-essential libevent-dev libncurses5-dev
wget https://github.com/tmux/tmux/releases/download/${{ matrix.tmux_version }}/tmux-${{ matrix.tmux_version }}.tar.gz
tar -zxf tmux-${{ matrix.tmux_version }}.tar.gz
cd tmux-${{ matrix.tmux_version }}
./configure && make && sudo make install
cd ..
- name: Run all tests
run: make test

9
Makefile Normal file
View File

@@ -0,0 +1,9 @@
default: test
.PHONY: lint
lint:
cd test && golangci-lint run -v
.PHONY: test
test:
cd test && go test -v