Merge pull request #332 from ghthor/switch-to-github-actions
[ci] switch to github actions
This commit is contained in:
33
.github/workflows/test.yml
vendored
Normal file
33
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
test_shell:
|
||||||
|
- bash
|
||||||
|
- zsh
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
uses: sudo-bot/action-shunit2@latest
|
||||||
|
env:
|
||||||
|
TEST_SHELLS: ${{ matrix.test_shell }}
|
||||||
|
with:
|
||||||
|
cli: ./run_tests.sh
|
||||||
18
.travis.yml
18
.travis.yml
@@ -1,18 +0,0 @@
|
|||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
|
|
||||||
env:
|
|
||||||
- TEST_SHELLS=bash
|
|
||||||
- TEST_SHELLS=zsh
|
|
||||||
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
install:
|
|
||||||
- ./test/support/travisci_deps.sh
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- echo -e "test_repo_11\ntest_repo_1" | sort
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./run_tests.sh
|
|
||||||
@@ -172,8 +172,8 @@ if [ "$git_setup_aliases" = "yes" ]; then
|
|||||||
_alias "$git_log_graph_alias" 'git log --graph --max-count=5'
|
_alias "$git_log_graph_alias" 'git log --graph --max-count=5'
|
||||||
_alias "$git_add_all_alias" 'git add --all .'
|
_alias "$git_add_all_alias" 'git add --all .'
|
||||||
|
|
||||||
# Hub aliases (https://github.com/github/hub)
|
# GitHub CLI aliases (https://github.com/cli/cli)
|
||||||
_alias "$git_pull_request_alias" 'git pull-request'
|
_alias "$git_pull_request_alias" 'gh pr'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Installs dependencies for travis-ci environments.
|
|
||||||
|
|
||||||
# Install dependencies, which looks to be just bash & zsh.
|
|
||||||
#
|
|
||||||
# Darwin has zsh preinstalled already, so only need to install on Ubuntu.
|
|
||||||
#
|
|
||||||
# Note: $TRAVIS_OS_NAME will only be set on text boxes with multi-os enabled,
|
|
||||||
# so use negation test so it will fail gracefully on normal Travis linux setup.
|
|
||||||
if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then
|
|
||||||
|
|
||||||
# okay, so we know we're probably on a linux box (or at least not an osx box)
|
|
||||||
# at this point. do we need to install zsh? let's say the default case is no:
|
|
||||||
needs_zsh=false
|
|
||||||
|
|
||||||
# check if zsh is listed in the TEST_SHELLS environment variable, set by
|
|
||||||
# our travis-ci build matrix.
|
|
||||||
if [[ $TEST_SHELLS =~ zsh ]]; then needs_zsh=true; fi
|
|
||||||
|
|
||||||
# if there is NO $TEST_SHELLS env variable persent (which should never happen,
|
|
||||||
# but maybe someone has been monkeying with the .travis.yml), run_tests.sh is
|
|
||||||
# going to fall back onto the default of testing everything, so we need zsh.
|
|
||||||
if [[ -z "$TEST_SHELLS" ]]; then needs_zsh=true; fi
|
|
||||||
|
|
||||||
# finally, we install zsh if needed!
|
|
||||||
if $needs_zsh; then
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install zsh
|
|
||||||
else
|
|
||||||
echo "No deps required."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user