From 60f78960dc204966c04f5ee99f23be9c43d7e8e2 Mon Sep 17 00:00:00 2001
From: Katsuya Hidaka <hidakatsuya@gmail.com>
Date: Sat, 10 May 2025 15:04:42 +0900
Subject: Run system tests on GitHub CI

---
 .github/workflows/tests.yml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index c27e3f605..6b35830a9 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -110,3 +110,23 @@ jobs:
       - name: Run autoload test
         run: |
           bin/rails test:autoload
+
+      # System tests use Chrome and ChromeDriver installed on the GitHub Actions Ubuntu image.
+      # They are generally updated to the latest stable versions.
+      - name: Run system tests
+        run: |
+          google-chrome --version
+          bin/rails test:system
+        env:
+          GOOGLE_CHROME_OPTS_ARGS: headless,disable-gpu,no-sandbox,disable-dev-shm-usage
+        # System tests might still be a bit unstable, so for now, even if a system test fails,
+        # output the results and consider the overall test as successful.
+        continue-on-error: true
+
+      - name: Upload system test screenshots
+        if: always()
+        uses: actions/upload-artifact@v4
+        with:
+          name: system-test-screenshots-ruby${{ matrix.ruby }}-${{ matrix.db }}
+          path: tmp/screenshots
+          if-no-files-found: ignore
-- 
2.45.2

