Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for macOS and Ubuntu #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build
on:
- push
- pull_request
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
name: ${{ matrix.os }} Ruby ${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu', 'macos']
ruby: [ '2.6', '2.7', '3.0' ]
runs-on: ${{ matrix.os }}-latest
steps:
- name: Set up portaudio (ubuntu)
if: ${{ matrix.os == 'ubuntu' }}
run: |
sudo apt update -y
sudo apt install -y -V portaudio19-dev
- name: Set up portaudio (macos)
if: ${{ matrix.os == 'macos' }}
run: |
brew install portaudio
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Rake test
run: bundle exec rake test
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ source "http://rubygems.org"

gemspec

gem "rake", "~> 12.0", group: :development
group :development do
gem "rake", "~> 12.0"
gem "test-unit"
end
4 changes: 4 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'bundler/setup'
Bundler.require(:development)
require 'test/unit'
require 'ffi-portaudio'
11 changes: 11 additions & 0 deletions test/test_ffi-portaudio.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require_relative 'helper'

class TestFFIPortaudio < Test::Unit::TestCase
test :it_has_a_version_number do
assert_kind_of String, ::FFI::PortAudio::VERSION
end

test :it_get_portaudio_version_number do
assert_kind_of String, ::FFI::PortAudio::API.Pa_GetVersionText
end
end