Skip to content

Commit

Permalink
Merge pull request #43 from doits/update_github_ci
Browse files Browse the repository at this point in the history
update github ci
  • Loading branch information
evman182 committed May 3, 2024
2 parents b23ea57 + 5be7f03 commit f64c329
Showing 1 changed file with 45 additions and 24 deletions.
69 changes: 45 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,48 @@ name: Continuous Integration
on:
push:
branches:
- '**'
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- master

jobs:
rubocop:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby: ["3.3"]
gemfile:
- "gemfiles/Gemfile.7.1.pg"
env:
BUNDLE_GEMFILE: ${{github.workspace}}/${{matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
- name: Bundle
run: bundle install

- name: Run Rubocop
run: bundle exec rubocop

tests:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:11.5
image: ${{ endsWith(matrix.gemfile, '.pg') && 'postgres:16' || '' }}
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:8.0
image: ${{ endsWith(matrix.gemfile, '.mysql') && 'mysql:8' || '' }}
env:
MYSQL_ROOT_PASSWORD: password
ports: ["3306:3306"]
Expand All @@ -29,8 +53,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0.6", "3.1.4", "3.2.2"]
gemfile:
ruby: ["3.0", "3.1", "3.2", "3.3"]
gemfile:
- "gemfiles/Gemfile.6.1.mysql"
- "gemfiles/Gemfile.6.1.pg"
- "gemfiles/Gemfile.7.0.mysql"
Expand All @@ -40,26 +64,23 @@ jobs:
env:
BUNDLE_GEMFILE: ${{github.workspace}}/${{matrix.gemfile }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
- name: Bundle
run: |
gem install bundler:2.4.10
bundle install
- name: Run Rubocop
run: bundle exec rubocop
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
- name: Bundle
run: bundle install

- name: Run Tests
env:
PGHOST: localhost
PGUSER: postgres
run: bundle exec rspec
- name: Run Tests
env:
PGHOST: localhost
PGUSER: postgres
run: bundle exec rspec

publish:
needs: [tests]
needs:
- rubocop
- tests
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')

Expand All @@ -68,9 +89,9 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
ruby-version: "3.3"
bundler-cache: true
- uses: rubygems/release-gem@v1

0 comments on commit f64c329

Please sign in to comment.