From bb78b86cf062ea54b10f3e6b67e4015c2b2dda4d Mon Sep 17 00:00:00 2001 From: Tom Strassner Date: Thu, 10 Oct 2024 08:54:38 -0500 Subject: [PATCH] Add CI file with rubocop and requirements coverage --- .github/workflows/ruby.yml | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..0bf9532 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,72 @@ +name: Ruby + +on: + push: + branches: [ main, fi-3237-add-ci ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.1.2'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + test: + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.1.2'] + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake + + lint: + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.1.2'] + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Rubocop + run: bundle exec rubocop + + requirements-coverage: + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.1.2'] + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Create Database + run: bundle exec inferno migrate + - name: Check Coverage + run: bundle exec rake requirements:check_coverage \ No newline at end of file