From b44ef986bff49c449919de1ac9da8deaa3ce0535 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 14 Nov 2024 08:30:43 +0900 Subject: [PATCH 1/3] Stop bundling webdrivers because it tries to use an old version of Chrome and causes ERROR Selenium Exception occurred: Unable to find latest point release version for 130.0.6723. --- Gemfile | 1 - Gemfile.lock | 5 ----- 2 files changed, 6 deletions(-) diff --git a/Gemfile b/Gemfile index 5f3eae436..658a4d4ba 100644 --- a/Gemfile +++ b/Gemfile @@ -101,5 +101,4 @@ group :development, :test do gem 'selenium-webdriver' gem 'spring' gem 'timecop' - gem 'webdrivers', '~> 4.7' end diff --git a/Gemfile.lock b/Gemfile.lock index 90d9906ae..14577e876 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -512,10 +512,6 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (4.7.0) - nokogiri (~> 1.6) - rubyzip (>= 1.3.0) - selenium-webdriver (> 3.141, < 5.0) webpacker (5.4.4) activesupport (>= 5.2) rack-proxy (>= 0.6.1) @@ -611,7 +607,6 @@ DEPENDENCIES uglifier (>= 1.3.0) underscore-rails web-console - webdrivers (~> 4.7) webpacker RUBY VERSION From 8920acd907bface2084aa90039561b660c27413c Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 14 Nov 2024 17:08:38 +0900 Subject: [PATCH 2/3] Use the latest node 15 release --- .node-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.node-version b/.node-version index c915b5db7..fc2cbe502 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -15.4.0 +15.14.0 From addc9b551b00980f0f8554812c17b3f7a728c9e6 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 14 Nov 2024 06:31:52 +0900 Subject: [PATCH 3/3] CI on GitHub Actions --- .github/workflows/test.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..935c4594a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - 5432:5432 + options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libvips postgresql-client libpq-dev + + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - uses: actions/setup-node@v4 + with: + node-version: '15.14.0' + + - name: Run tests + env: + RAILS_ENV: test + DATABASE_URL: postgres://postgres@localhost:5432/cfp_app_test + run: bin/rails db:setup assets:precompile spec + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/capybara + if-no-files-found: ignore