Skip to content

Commit

Permalink
Setup GitHub Actions CI
Browse files Browse the repository at this point in the history
Try to setup GitHub Actions CI.
  • Loading branch information
MikeMcQuaid committed Aug 14, 2019
1 parent 83dce41 commit 26b87cb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 55 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: GitHub Actions CI
on: [push]
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]

steps:
- name: Set up Git repository
uses: actions/checkout@master

- name: Reset system Homebrew installation
run: brew update-reset
if: matrix.os == 'macOS-latest'

- name: Check Ruby style
run: brew style homebrew/bundle
if: matrix.os == 'macOS-latest'

- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
version: '>=2.3'
if: matrix.os == 'ubuntu-latest'

- name: Environment dump
run: env

- name: Install RubyGems
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run RSpec tests
run: bundle exec rspec
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
45 changes: 0 additions & 45 deletions azure-pipelines.yml

This file was deleted.

17 changes: 7 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,18 @@ def linux?

formatters = [SimpleCov::Formatter::HTMLFormatter]

# Coveralls in Azure Pipelines
if ENV["COVERALLS_REPO_TOKEN"] && ENV["TF_BUILD"]
if macos? && ENV["COVERALLS_REPO_TOKEN"]
require "coveralls"

formatters << Coveralls::SimpleCov::Formatter

ENV["CI"] = "1"
ENV["CI_NAME"] = "azure-pipelines"
ENV["CI_BUILD_NUMBER"] = ENV["BUILD_BUILDID"]
ENV["CI_BUILD_URL"] = "#{ENV["SYSTEM_TEAMFOUNDATIONSERVERURI"]}#{ENV["SYSTEM_TEAMPROJECT"]}/_build/results?buildId=#{ENV["BUILD_BUILDID"]}"
ENV["CI_BRANCH"] = ENV["BUILD_SOURCEBRANCH"]
ENV["CI_PULL_REQUEST"] = ENV["SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"]

require "simplecov-cobertura"
formatters << SimpleCov::Formatter::CoberturaFormatter
ENV["CI_NAME"] = "github-actions"
ENV["CI_BUILD_NUMBER"] = ENV["RUNNER_TRACKING_ID"]
ENV["CI_BRANCH"] = ENV["GITHUB_REF"]
# TODO: fill out values when more env vars available.
# ENV["CI_BUILD_URL"] =
# ENV["CI_PULL_REQUEST"] = ENV["SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"]
end

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
Expand Down

0 comments on commit 26b87cb

Please sign in to comment.