diff --git a/.github/workflows/ci_steps.yml b/.github/workflows/ci_steps.yml new file mode 100644 index 0000000..bb09155 --- /dev/null +++ b/.github/workflows/ci_steps.yml @@ -0,0 +1,50 @@ +# 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 install a prebuilt Ruby version, install dependencies, and +# run tests and linters. +name: "Frederick API Gem CI" +on: [push, pull_request] + +env: + RUBY_VERSION: 2.4.3 + DOCKER: true + RAILS_ENV: test + +jobs: + # RSpec tests + rspec-tests: + name: "RSpec Tests" + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - name: Run RSpec tests + run: bundle exec rspec + + # Rubocop linting + lint: + name: "Lint" + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - name: Lint Ruby files + run: bundle exec rubocop \ No newline at end of file