From 171cf57fd2f464b3f36ddf228216427fb0fccd56 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Thu, 25 May 2023 15:49:22 -0400 Subject: [PATCH] Switch from Travis to GitHub Actions --- .github/workflows/base-tests.yaml | 47 +++++++++++++++++++++++++++++++ .travis.yml | 16 ----------- README.md | 2 +- {travis => ci}/dummy_docker | 0 travis/install.sh | 29 ------------------- 5 files changed, 48 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/base-tests.yaml delete mode 100644 .travis.yml rename {travis => ci}/dummy_docker (100%) delete mode 100755 travis/install.sh diff --git a/.github/workflows/base-tests.yaml b/.github/workflows/base-tests.yaml new file mode 100644 index 00000000..fbf21489 --- /dev/null +++ b/.github/workflows/base-tests.yaml @@ -0,0 +1,47 @@ +name: Tests + +on: + push: + pull_request: + +jobs: + base-test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - macos-latest + - ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@3 + + - name: Install dependencies (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') + run: | + # So we get all backports etc + bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) + sudo apt-get update -qq + sudo apt-get install eatmydata # to speedup some installations + sudo eatmydata apt-get install singularity-container shellcheck bats git-annex-standalone + + - name: Install dependencies (macOS) + if: startsWith(matrix.os, 'macos') + run: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install shellcheck + HOMEBREW_NO_AUTO_UPDATE=1 brew install git-annex + HOMEBREW_NO_AUTO_UPDATE=1 brew install bats + sudo cp ci/dummy_docker /usr/local/bin/docker + + - name: Fetch git-annex data + run: | + git fetch origin git-annex + git remote add --fetch datalad.datasets.org http://datasets.datalad.org/repronim/containers/.git + git annex upgrade # we need v7 for the unlocked test img + + - name: Shellcheck code examples + run: grep -m 1 -l '^#!/bin/.*sh' | grep -v '\.\(txt\|md\)' | xargs shellcheck + + - name: Run script tests + run: bats -t scripts/tests diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3b2dfa0b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -# ATM we are pure bash scripts but eventually might RF into Python -language: python - -matrix: - include: - - os: linux - python: 3.6 - - os: osx - language: generic - -install: - - travis_retry ./travis/install.sh - -script: - - grep -m 1 -l '^#!/bin/.*sh' | grep -v '\.\(txt\|md\)' | xargs shellcheck - - bats -t scripts/tests diff --git a/README.md b/README.md index 18e8b937..c21cdf5a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ReproNim/containers - containerized environments for reproducible neuroimaging -[![Travis tests status](https://secure.travis-ci.org/ReproNim/containers.png?branch=master)](https://travis-ci.org/ReproNim/containers) +[![CI Status](https://github.com/RepoNim/containers/actions/workflows/base-tests.yaml/badge.svg)](https://github.com/RepoNim/containers/actions/workflows/base-tests.yaml) [![Additional tests](https://github.com/ReproNim/containers/workflows/Additional%20tests/badge.svg)](https://github.com/ReproNim/containers/actions?query=workflow%3A%22Additional+tests%22) This repository provides a [DataLad] dataset (git/git-annex diff --git a/travis/dummy_docker b/ci/dummy_docker similarity index 100% rename from travis/dummy_docker rename to ci/dummy_docker diff --git a/travis/install.sh b/travis/install.sh deleted file mode 100755 index 29c9fd40..00000000 --- a/travis/install.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -ev - -git clone https://github.com/matthew-brett/multibuild ~/multibuild -# shellcheck disable=SC1090 -source ~/multibuild/osx_utils.sh - -if [ "$TRAVIS_OS_NAME" = linux ] -then - # So we get all backports etc - bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) - sudo apt-get update -qq - sudo apt-get install eatmydata # to speedup some installations - sudo eatmydata apt-get install singularity-container shellcheck bats git-annex-standalone -else - # osx - HOMEBREW_NO_AUTO_UPDATE=1 brew install shellcheck - HOMEBREW_NO_AUTO_UPDATE=1 brew install git-annex - git clone https://github.com/sstephenson/bats.git ~/bats - ( cd ~/bats ; sudo ./install.sh /usr/local ) - sudo cp travis/dummy_docker /usr/local/bin/docker -fi - -git fetch origin git-annex -git remote add --fetch datalad.datasets.org http://datasets.datalad.org/repronim/containers/.git -git annex upgrade # we need v7 for the unlocked test img - -exit 0