Skip to content

Commit

Permalink
Run tests in GitHub Actions instead of Travis CI
Browse files Browse the repository at this point in the history
Replace Travis CI configuration and run trigger file with an equivalent
GitHub Actions workflow to run bats-core units tests on pushes to pull
requests targeting master, or pushes to master itself.

Currently limited to running on Ubuntu 16.04 to avoid OpenSSL warning
mesages from later versions (see #55) from breaking the
(too fragile) tests.
  • Loading branch information
jmurty committed Apr 28, 2020
1 parent bf2b0e5 commit 9fd84ff
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/run-bats-core-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests

on:
# Only run tests on push to master branch
push:
branches: [master]
# Run tests for all pull request changes targeting master
pull_request:
branches: [master]

jobs:
test:
# We use older Ubuntu for now to avoid warning from newer OpenSSL (#55)
# which break output expectations in some (fragile) tests
runs-on: ubuntu-16.04

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install and set up bats-core
run: |
git clone https://github.com/bats-core/bats-core.git /tmp/bats-core-repo
mkdir -p /tmp/bats-core
bash /tmp/bats-core-repo/install.sh /tmp/bats-core
# Need to configure git globally to avoid errors when we create and use
# temporary test-specific Git repos fatal: `empty ident name`
- name: Configure dummy Git user.[name,email] values
run: |
git config --global user.name github-actions-user
git config --global user.email [email protected]
- name: Run tests
run: /tmp/bats-core/bin/bats tests/
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ to work normally on your local working copy. You can conveniently store things
like passwords and private keys within your repository and not have to share
them with your entire team or complicate your workflow.

![Tests](https://github.com/elasticdog/transcrypt/workflows/Tests/badge.svg)

## Overview

transcrypt is in the same vein as existing projects like
Expand Down

0 comments on commit 9fd84ff

Please sign in to comment.