From 3b74f362fc9af92de60fa17b5f0527b5c5e9a451 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Sat, 4 Feb 2023 22:24:03 +0000 Subject: [PATCH 1/3] Migrate from Travis CI to GitHub Actions HT https://akx.github.io/travis-to-github-actions/ --- .github/workflows/github-actions.yml | 38 ++++++++++++++++++++++ .travis.yml | 47 ---------------------------- 2 files changed, 38 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/github-actions.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..765cd0c --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,38 @@ +name: Converted Workflow +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + os: + - ubuntu-18.04 + steps: + - name: Install dependencies (Ubuntu) + if: runner.os == 'Linux' + run: |- + sudo apt-get update + sudo apt-get install -y google-chrome-stable + - uses: actions/checkout@v2 + - run: gem update --system + - run: gem install bundler + - run: >- + curl -O + https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip + - run: unzip chromedriver_linux64.zip -d chromedriver + - run: 'export PATH=$PATH:`pwd`/chromedriver' + - run: >- + curl -L + https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 + -o ./cc-test-reporter + - run: chmod +x ./cc-test-reporter + - run: ./cc-test-reporter before-build + - run: cp config/database.yml.sample config/database.yml + - run: 'bundle exec rake db:create db:migrate spec' + - run: ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7e471bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -dist: trusty -sudo: false - -language: ruby - -rvm: - - 2.7.7 - -addons: - postgresql: "9.6" - apt: - packages: - - google-chrome-stable - -cache: bundler - -bundler_args: --jobs=3 --retry=3 --deployment --without development production - -env: - global: - - CC_TEST_REPORTER_ID=b5a454e6327e5f7d992fe50ae2c1f742f37e6fb536286312e0e11ddab193ca80 - -branches: - only: - - master - -before_install: - - gem update --system - - gem install bundler - -before_script: - - curl -O https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip - - unzip chromedriver_linux64.zip -d chromedriver - - export PATH=$PATH:`pwd`/chromedriver - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -o ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - - cp config/database.yml.sample config/database.yml - -script: bundle exec rake db:create db:migrate spec - -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - -notifications: - slack: - secure: c+9K1YyGPnoVYrGm5L47ojKu8cCBROSRnsB2O3FY3xfuD0CDtCTXrWQa1bOz02jnMbDmUe0BmP2dNM1m+I2Ppps3xDYIRMBIPYAJN30/ot4yCiJFKGbz2rjhzEun70yqV0h/ej+LC4Mx2/5FwACvLhw/EE0GRx64rT7Kju5LrLGmjpJYxvfvWQfKiJ4ggQSKAPe4CnKHtHTUkDlAjTi+dIFw1VYcd11IxKOizQsyQPU7ZNA3kb/dKcwcbhcm0EUrLXpJesxPVSC0v0NcYkaQACUVje9Sxo8wck/CTFDi8oZSE2aI+CiH6ekaSxNKuduk0mW7zEQzOfc7dhu9BGc4/5zCSAMJEkCsgZQAiSqvXy1K6rWy5XgphyBUCpoyFu+5umu7wniGA7kWojl5XwsIDap+rjhO3rIrfP2Jnvg8T2QHGY6TP1SLK9PHbwvDd+JeWoxllPu4xbhjuADzZH0ui3MODtjNpcRhBtUjDHl8OGLuVsxKQrn3GBNbCgS2+jKyo+R2JkxyOAAEGWIgyA6Sbpa2IxjjOLDxaNaDQeoY0YJaFbL4QHjC/Ppqs2FkR8LiEisy/l4w0HcaaRlehWgbnvL11PKSVOxWtUEUp2gLOFA9HnZe+fwUWxhuy5WJU+ilHOHwo/taWWy0sngesH8jj0ub9DfQEPWJ4FCzClZJ9z0= From b86be6e068b8c8fb5099ea23cbfdd366314d0dd4 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Sat, 4 Feb 2023 22:29:52 +0000 Subject: [PATCH 2/3] Use sudo with gem command --- .github/workflows/github-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 765cd0c..4954073 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -20,8 +20,8 @@ jobs: sudo apt-get update sudo apt-get install -y google-chrome-stable - uses: actions/checkout@v2 - - run: gem update --system - - run: gem install bundler + - run: sudo gem update --system + - run: sudo gem install bundler - run: >- curl -O https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip From 54e7aa5ec35c8c0a84a7b787967732379231ca18 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Sat, 4 Feb 2023 22:47:08 +0000 Subject: [PATCH 3/3] UPDATE --- .github/workflows/github-actions.yml | 87 +++++++++++++++++----------- 1 file changed, 54 insertions(+), 33 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 4954073..3fc3100 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -1,38 +1,59 @@ -name: Converted Workflow +name: "Activities CI" on: push: - branches: - - master + branches: [ $default-branch ] pull_request: - branches: - - master + branches: [ $default-branch ] jobs: - build: - runs-on: '${{ matrix.os }}' - strategy: - matrix: - os: - - ubuntu-18.04 + test: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:11-alpine + ports: + - "5432:5432" + env: + POSTGRES_DB: rails_test + POSTGRES_USER: rails + POSTGRES_PASSWORD: password + env: + RAILS_ENV: test + DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test" steps: - - name: Install dependencies (Ubuntu) - if: runner.os == 'Linux' - run: |- - sudo apt-get update - sudo apt-get install -y google-chrome-stable - - uses: actions/checkout@v2 - - run: sudo gem update --system - - run: sudo gem install bundler - - run: >- - curl -O - https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip - - run: unzip chromedriver_linux64.zip -d chromedriver - - run: 'export PATH=$PATH:`pwd`/chromedriver' - - run: >- - curl -L - https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 - -o ./cc-test-reporter - - run: chmod +x ./cc-test-reporter - - run: ./cc-test-reporter before-build - - run: cp config/database.yml.sample config/database.yml - - run: 'bundle exec rake db:create db:migrate spec' - - run: ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + - name: Checkout code + uses: actions/checkout@v3 + # Add or replace dependency steps here + - name: Install Ruby and gems + uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0 + with: + bundler-cache: true + # Add or replace database setup steps here + - name: Set up database schema + run: bin/rails db:schema:load + # Add or replace test runners here + - name: Run tests + run: bin/rake +# - name: Install dependencies (Ubuntu) +# +# if: runner.os == 'Linux' +# run: |- +# sudo apt-get update +# sudo apt-get install -y google-chrome-stable +# - uses: actions/checkout@v2 +# - run: sudo gem update --system +# - run: sudo gem install bundler +# - run: >- +# curl -O +# https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip +# - run: unzip chromedriver_linux64.zip -d chromedriver +# - run: 'export PATH=$PATH:`pwd`/chromedriver' +# - run: >- +# curl -L +# https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 +# -o ./cc-test-reporter +# - run: chmod +x ./cc-test-reporter +# - run: ./cc-test-reporter before-build +# - run: cp config/database.yml.sample config/database.yml +# - run: 'bundle exec rake db:create db:migrate spec' +# - run: ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT +#