From 2e5140f86c45893dfa15c21f8be520518068779c Mon Sep 17 00:00:00 2001 From: Florian Leinsinger Date: Thu, 27 Feb 2025 15:12:56 +0100 Subject: [PATCH 1/2] [D-359] minidusen - Switch to Ubuntu 24.04 image --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef549fa..e82b456 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ name: Tests - main jobs: test_mysql: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 services: mysql: image: mysql:5.6 @@ -53,7 +53,7 @@ jobs: - name: Run tests run: bundle exec rspec test_pg: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 services: postgres: image: postgres From a041ae90dda9572a105bd5340f284fb2a75753f4 Mon Sep 17 00:00:00 2001 From: Florian Leinsinger Date: Thu, 27 Feb 2025 17:29:28 +0100 Subject: [PATCH 2/2] Update github test config --- .github/workflows/test.yml | 59 ++++++++++++++++++-------------- spec/support/database.github.yml | 4 +-- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e82b456..cea8d2f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,24 +1,31 @@ --- name: Tests -'on': + +on: push: branches: - main pull_request: branches: - main + jobs: test_mysql: runs-on: ubuntu-24.04 + services: mysql: - image: mysql:5.6 + image: mysql:5.7 env: MYSQL_ROOT_PASSWORD: password - options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout - 5s --health-retries 5 + options: >- + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=5 ports: - 3306:3306 + strategy: fail-fast: false matrix: @@ -35,34 +42,40 @@ jobs: gemfile: Gemfile.7.2.mysql2 - ruby: 3.3.4 gemfile: Gemfile.8.0.mysql2 + env: - BUNDLE_GEMFILE: "${{ matrix.gemfile }}" + BUNDLE_GEMFILE: ${{ matrix.gemfile }} + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "${{ matrix.ruby }}" + ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: Setup database run: | - mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1 - - name: Bundle - run: | - gem install bundler:1.17.3 - bundle install --no-deployment + mysql -e 'create database IF NOT EXISTS minidusen_test;' -u root --password=password -P 3306 -h 127.0.0.1 - name: Run tests run: bundle exec rspec + test_pg: runs-on: ubuntu-24.04 + services: postgres: image: postgres env: POSTGRES_PASSWORD: postgres - options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s - --health-retries 5" + POSTGRES_DB: minidusen_test + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 ports: - 5432:5432 + strategy: fail-fast: false matrix: @@ -79,22 +92,16 @@ jobs: gemfile: Gemfile.7.2.pg - ruby: 3.3.4 gemfile: Gemfile.8.0.pg + env: - BUNDLE_GEMFILE: "${{ matrix.gemfile }}" + BUNDLE_GEMFILE: ${{ matrix.gemfile }} + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "${{ matrix.ruby }}" - - name: Setup database - run: | - sudo apt-get update - sudo apt-get install -y postgresql-client - PGPASSWORD=postgres psql -c 'create database test;' -U postgres -p 5432 -h localhost - - name: Bundle - run: | - gem install bundler:1.17.3 - bundle install --no-deployment + ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: Run tests run: bundle exec rspec diff --git a/spec/support/database.github.yml b/spec/support/database.github.yml index 9a09c07..454adee 100644 --- a/spec/support/database.github.yml +++ b/spec/support/database.github.yml @@ -1,12 +1,12 @@ mysql: - database: test + database: minidusen_test username: root password: password host: 127.0.0.1 port: 3306 postgresql: - database: test + database: minidusen_test host: localhost username: postgres password: postgres