From e7d7d75cb520b372bba3a4ae28b40663f8e48ba7 Mon Sep 17 00:00:00 2001 From: Jeff Lawson Date: Wed, 30 Dec 2020 14:54:08 -0600 Subject: [PATCH] Switch from Travis to Github Actions for CI (#36) --- .github/workflows/linux-ci.yml | 36 ++++++++++++++++++++++++++++++++++ .github/workflows/mac-ci.yml | 36 ++++++++++++++++++++++++++++++++++ .travis.yml | 27 ------------------------- README.md | 3 ++- 4 files changed, 74 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/linux-ci.yml create mode 100644 .github/workflows/mac-ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml new file mode 100644 index 0000000..63638bd --- /dev/null +++ b/.github/workflows/linux-ci.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: Linux CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -qq + sudo apt-get install -y gcc-7 g++-7 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 + sudo apt-get install -y tcl8.6-dev tcllib libyajl-dev + - name: configure + run: | + autoreconf -vi + ./configure --with-tcl=/usr/lib/tcl8.6 + - name: make + run: make + - name: install + run: sudo make install + - name: test + run: make test diff --git a/.github/workflows/mac-ci.yml b/.github/workflows/mac-ci.yml new file mode 100644 index 0000000..d52f1c7 --- /dev/null +++ b/.github/workflows/mac-ci.yml @@ -0,0 +1,36 @@ +name: Mac CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + brew update + brew install tcl-tk || true + brew install yajl + sudo mkdir -p /usr/local + sudo ln -sf /usr/local/opt/tcl-tk/include /usr/local/include/tcl8.6 + sudo cp /usr/local/opt/tcl-tk/lib/libtcl* /usr/local/lib + sudo ln -sf /usr/local/opt/tcl-tk/bin/tclsh8.6 /usr/local/bin/tclsh + sudo ln -sf /usr/local/opt/tcl-tk/bin/tclsh8.6 /usr/local/bin/tclsh8.6 + - name: configure + run: | + autoreconf -vi + ./configure --with-tcl=/usr/local/opt/tcl-tk/lib --prefix=/usr/local + - name: make + run: make + - name: install + run: sudo make install + - name: make test + run: make test + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3b651f5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: c - -sudo: true - -os: - - linux - - osx - -compiler: - - gcc - - clang - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install yajl; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install tcl-tk; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libyajl-dev -y; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install tcl8.6-dev -y; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install tcllib -y; fi - -script: - - autoreconf -vi - - if [ -f /usr/local/opt/tcl-tk/lib/tclConfig.sh ]; then ./configure --with-tcl=/usr/local/opt/tcl-tk/lib --prefix=/usr/local; else ./configure; fi - - make - - sudo make install - - make test diff --git a/README.md b/README.md index 327faec..95dc13f 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build Status](https://travis-ci.org/flightaware/yajl-tcl.svg?branch=master)](https://travis-ci.org/flightaware/yajl-tcl) +![Linux CI](https://github.com/flightaware/yajl-tcl/workflows/Linux%20CI/badge.svg) +![Mac CI](https://github.com/flightaware/yajl-tcl/workflows/Mac%20CI/badge.svg) ### This is yajl-tcl, a direct Tcl interface to the yajl JSON generator library.