From 178c72319549e79f67fa732388f269db1bf34f40 Mon Sep 17 00:00:00 2001 From: Matt Moretti Date: Wed, 16 Oct 2024 14:34:49 -0400 Subject: [PATCH] Add actions setup (#656) * Add actions setup * Remove Travis and CC setups --- .codeclimate.yml | 38 -------------------------------- .github/actions/setup/action.yml | 12 ++++++++++ .github/workflows/ci.yml | 27 +++++++++++++++++++++++ .travis.yml | 35 ----------------------------- 4 files changed, 39 insertions(+), 73 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index aec9e4b7..00000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,38 +0,0 @@ -engines: - brakeman: - enabled: true - bundler-audit: - enabled: true - csslint: - enabled: true - duplication: - enabled: true - config: - languages: - - ruby - fixme: - enabled: true - config: - strings: - - TODO - - HACK - - BUG - - FIXME - rubocop: - enabled: false - channel: rubocop-1-56-3 -ratings: - paths: - - Gemfile.lock - - "**.erb" - - "**.haml" - - "**.rb" - - "**.css" -exclude_paths: -- bin/**/* -- coverage/**/* -- config/**/* -- db/**/* -- spec/**/* -- vendor/**/* -- .codeclimate.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000..60673785 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,12 @@ +name: setup +description: Setup the repository +runs: + using: composite + steps: + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: yarn diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8dc23709 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: ci +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + rspec: + runs-on: ubuntu-latest + services: + mariadb: + image: mariadb:10.4 + env: + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true + ports: + - 3306:3306 + env: + RAILS_ENV: test + DATABASE_URL: mysql2://root@127.0.0.1:3306/jobapps_test + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - run: bin/setup + - run: bundle exec rspec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d1cd5644..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -dist: focal -language: ruby -cache: bundler -services: - - mysql -env: - global: - - CC_TEST_REPORTER_ID=d69084d39be74e8dafe9a689102b19130a21abe963dce8aa6146078098c9b242 -before_install: - - nvm install 'lts/*' - - nvm use 'lts/*' - - npm i -g yarn -install: - - bundle config set --local deployment 'true' - - bundle install --jobs=3 --retry=3 - - yarn -before_script: - - cp config/application.yml.example config/application.yml - - cp config/database.yml.example config/database.yml - - bundle exec rake db:reset - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build -script: - - bundle exec rspec -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -branches: - only: - - main -notifications: - email: - on_success: never - on_failure: change - recipients: programmers@admin.umass.edu