From e4c0fa5043edade122cc4a5eaa0fc573bb603d04 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Wed, 17 Feb 2021 12:30:45 +0100 Subject: [PATCH] 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. --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..02fabffdd0 --- /dev/null +++ b/.github/workflows/build.yml @@ -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