Add Github CI build workflow

based on
https://docs.github.com/en/actions/guides/building-and-testing-ruby#starting-with-the-ruby-workflow-template.

Things worth mentioning:

* ruby/setup-ruby reads `.ruby-version` by default. See:
https://github.com/ruby/setup-ruby#supported-version-syntax
* I chose to run on ubuntu-18.04 because that's what we use in
production. This should reduce potential "it runs on machine but fails
in CI" due to different system libraries versions and such.

We're temporarily running only `spec/queries/` specs because we want it
to finish quickly as we iterate on its configuration.
This commit is contained in:
Pau Perez
2021-02-17 12:30:45 +01:00
parent 297927c8df
commit e4c0fa5043

28
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Build
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rspec spec/queries