From 1121f3bff01ec5f9907950fb29c3d4c619818a6f Mon Sep 17 00:00:00 2001 From: Hampton Lintorn-Catlin Date: Fri, 20 Feb 2026 15:47:56 -0600 Subject: [PATCH] Add GitHub Actions CI workflow for running tests Amp-Thread-ID: https://ampcode.com/threads/T-019c7cf8-be9f-709b-86dc-3837e4d16db6 Co-authored-by: Amp --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d66a7b4e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping -h 127.0.0.1" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + + env: + RAILS_ENV: test + DATABASE_URL: mysql2://root@127.0.0.1:3306/planning_department_test + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Create database + run: bin/rails db:create db:schema:load + + - name: Run tests + run: bin/rails test