From dd7a867686bf33ad5824aff98b0370212fb27ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Almeida?= Date: Wed, 24 Nov 2021 10:53:09 -0300 Subject: [PATCH 1/2] Adiciona Github Actions --- .github/workflows/main.yml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6233aba --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,57 @@ +name: Rails Pipeline + +env: + RUBY_VERSION: 2.7.2 + NODE_VERSION: 12.18.1 + BUNDLER_VERSION: 2.1.4 + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + workflow: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup System + run: sudo apt-get install -y libsqlite3-dev + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + + - name: Bundle install + run: | + gem uninstall -aIx bundler + gem install bundler -v ${{ env.BUNDLER_VERSION }} + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Yarn Install + run: bin/yarn + + - name: Rspec + run: | + bundle exec rails db:prepare + bundle exec rspec + + - name: Rubocop + run: bundle exec rubocop -c .rubocop.yml + + - name: Audit + run: | + gem install bundler-audit + bundle-audit --update From c5b58b35c1e5de76dded57adca7c06a8e82581ff Mon Sep 17 00:00:00 2001 From: Joao Almeida Date: Wed, 24 Nov 2021 11:29:40 -0300 Subject: [PATCH 2/2] Change Ruby version on GH Actions --- .github/workflows/main.yml | 2 +- spec/system/user_cancel_reservation_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 spec/system/user_cancel_reservation_spec.rb diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6233aba..95dea85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Rails Pipeline env: - RUBY_VERSION: 2.7.2 + RUBY_VERSION: 2.7.1 NODE_VERSION: 12.18.1 BUNDLER_VERSION: 2.1.4 diff --git a/spec/system/user_cancel_reservation_spec.rb b/spec/system/user_cancel_reservation_spec.rb new file mode 100644 index 0000000..b66640f --- /dev/null +++ b/spec/system/user_cancel_reservation_spec.rb @@ -0,0 +1,2 @@ +require 'rails_helper' +