Skip to content

Commit

Permalink
Switch from Travis CI to GitHub Actions
Browse files Browse the repository at this point in the history
Closes jonas#1061
  • Loading branch information
krobelus authored and koutcher committed Feb 4, 2021
1 parent 2b3c6be commit 9a3b2b8
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 43 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linux

on: [push, pull_request]

jobs:
ci:
runs-on: ubuntu-20.04

strategy:
matrix:
compiler: [clang, gcc]
tig_build: [autoconf, "config.make"]
include:
- name: Address Sanitizer
compiler: clang
tig_build: "address-sanitizer"

- name: Valgrind
compiler: gcc
tig_build: valgrind

steps:
- uses: actions/checkout@v2
- name: Test Tig
shell: 'script -q -e -c "sh {0}"' # Workaround to get a TTY, see https://github.com/gfx/example-github-actions-with-tty
run: |
set -ex
export LANG=en_US.utf8
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt -yq install --no-install-recommends \
asciidoc valgrind xmlto
CC=${{ matrix.compiler }} TIG_BUILD=${{ matrix.tig_build }} tools/travis.sh
38 changes: 38 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: macOS

on:
push:
branches: [ master ]

jobs:
install:
runs-on: macos-latest

strategy:
matrix:
compiler: [clang, gcc]

steps:
- name: Patch
run: |
cd "$(brew --repo homebrew/core)" && patch -p1 <<\EOF
diff --git a/Formula/tig.rb b/Formula/tig.rb
index 2e8c125660..f76d6bca1c 100644
--- a/Formula/tig.rb
+++ b/Formula/tig.rb
@@ -26,9 +26,11 @@ class Tig < Formula
depends_on "readline"
def install
+ ENV.deparallelize
system "./autogen.sh" if build.head?
system "./configure", "--prefix=#{prefix}", "--sysconfdir=#{etc}"
system "make"
+ system "make", "test"
# Ensure the configured `sysconfdir` is used during runtime by
# installing in a separate step.
system "make", "install", "sysconfdir=#{pkgshare}/examples"
EOF
- name: Install latest Tig
shell: 'script -q typescript sh {0}' # Workaround to get a TTY, see https://github.com/gfx/example-github-actions-with-tty
run: HOMEBREW_CC=${{ matrix.compiler }} HOMEBREW_NO_AUTO_UPDATE=1 brew install --HEAD tig
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Tig: text-mode interface for Git
================================
:docext: adoc

image:https://secure.travis-ci.org/jonas/tig.svg?branch=master[Travis Build,link=https://travis-ci.org/jonas/tig]
image:https://github.com/jonas/tig/workflows/Linux/badge.svg[Linux CI,link=https://github.com/jonas/tig/actions?query=workflow%3A.github%2Fworkflows%2Flinux.yml]
image:https://github.com/jonas/tig/workflows/macOS/badge.svg[macOS CI,link=https://github.com/jonas/tig/actions?query=workflow%3A.github%2Fworkflows%2Fmacos.yml]
image:https://ci.appveyor.com/api/projects/status/jxt1uf52o7r0a8r7/branch/master?svg=true[AppVeyor Build,link=https://ci.appveyor.com/project/fonseca/tig]
image:https://badges.gitter.im/Join%20Chat.svg[Join Chat,link="https://gitter.im/jonas/tig?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]

Expand Down
4 changes: 2 additions & 2 deletions test/tools/libtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ run_test_cases()
tigrc "$(cat < "$name-tigrc")"
fi
if [ -e "$name-before" ]; then
test_exec_work_dir "$SHELL" "$HOME/$name-before"
test_exec_work_dir "${SHELL:-/bin/sh}" "$HOME/$name-before"
fi
(
if [ -e "$name-cwd" ]; then
Expand All @@ -828,7 +828,7 @@ run_test_cases()
test_tig $(if [ -e "$name-args" ]; then cat < "$name-args"; fi)
)
if [ -e "$name-after" ]; then
test_exec_work_dir "$SHELL" "$HOME/$name-after"
test_exec_work_dir "${SHELL:-/bin/sh}" "$HOME/$name-after"
fi

assert_equals "$name.screen" < "$name.expected"
Expand Down

0 comments on commit 9a3b2b8

Please sign in to comment.