From 995000e342a8a0c446f355bf42467a3caf693bec Mon Sep 17 00:00:00 2001 From: Jose Farias Date: Sat, 3 Feb 2024 14:02:48 -0600 Subject: [PATCH] Configure CI --- .github/workflows/ci_tests.yml | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci_tests.yml diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml new file mode 100644 index 0000000..12d72b7 --- /dev/null +++ b/.github/workflows/ci_tests.yml @@ -0,0 +1,54 @@ +name: CI Tests + +on: + push: + branches: + - main + - jose/ci + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3.0 + + - name: Install dependencies + run: | + sudo apt-get update -yqq + sudo apt-get install -yqq libsqlite3-dev + gem install bundler + bundle install --jobs 4 --retry 3 + + - name: Setup database + run: | + bundle exec rake db:create + bundle exec rake db:schema:load + + - name: Load fixtures + run: bundle exec rake db:fixtures:load + + - name: Setup Chrome and Chromedriver + run: | + sudo apt-get update + sudo apt-get install -yqq google-chrome-stable + CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` + wget -N http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip -P ~/ + unzip ~/chromedriver_linux64.zip -d ~/ + sudo mv -f ~/chromedriver /usr/local/bin/chromedriver + sudo chown root:root /usr/local/bin/chromedriver + sudo chmod 0755 /usr/local/bin/chromedriver + + - name: Run tests + run: bundle exec rake app:test + + - name: Run system tests + env: + RAILS_ENV: test + DATABASE_URL: sqlite3:db/test.sqlite3 + HEADLESS_CHROME: true + run: bundle exec rake app:test:system