diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aad40dd1..75b535e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,31 +12,18 @@ jobs: rubocop: name: runner / rubocop runs-on: ubuntu-latest - strategy: - matrix: - rails_version: -# - 6_1 - - 7_0 -# - 7_1 -# - master + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_7_0.gemfile steps: - uses: actions/checkout@v4 - - name: Read .ruby-version file - id: getrubyversion - run: echo "RUBY_VERSION=$(cat .ruby-version)" >> $GITHUB_OUTPUT - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ steps.getrubyversion.outputs.RUBY_VERSION }} - - run: ls -la - - name: Set up Rails ${{ matrix.rails_version }} - run: | - bundle config set --local gemfile "gemfiles/rails_${{ matrix.rails_version }}.gemfile" - bundle config set --local path 'vendor/bundle' - bundle install + bundler-cache: true - name: Rubocop run: "bundle exec rubocop" test: + name: rails / rspec runs-on: ubuntu-latest strategy: matrix: @@ -47,29 +34,24 @@ jobs: - 6_1 - 7_0 - 7_1 -# - master - # Service containers to run with `container-job` + #- master + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}.gemfile services: - # Label used to access the service container postgres: - # Docker Hub image - image: postgres:14 - # Provide the password for postgres + image: postgres:14 # pg_dump tests currently depend on this version env: POSTGRES_PASSWORD: postgres POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_DB: apartment_postgresql_test - # Set health checks to wait until postgres has started options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - # Maps tcp port 5432 on service container to the host - 5432:5432 mysql: - # Docker Hub image image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: true @@ -80,7 +62,6 @@ jobs: --health-timeout 5s --health-retries 5 ports: - # Maps tcp port 3306 on service container to the host - 3306:3306 steps: - uses: actions/checkout@v4 @@ -88,16 +69,10 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - - name: Set up Rails ${{ matrix.rails_version }} - run: | - bundle config set --local gemfile "gemfiles/rails_${{ matrix.rails_version }}.gemfile" - bundle config set --local path 'vendor/bundle' - bundle install + bundler-cache: true - name: Configure config database.yml run: bundle exec rake db:copy_credentials - name: Database Setup run: bundle exec rake db:test:prepare - name: Run tests run: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/test-results/rspec/rspec.xml -# - store_test_results: -# path: ~/test-results/rspec/ \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 39e446ac..96016cce 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,6 +7,7 @@ require: AllCops: Exclude: + - vendor/bundle/**/* - gemfiles/**/*.gemfile - gemfiles/vendor/**/* - spec/dummy_engine/dummy_engine.gemspec