Skip to content

Commit

Permalink
create git workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
takaebato committed Mar 15, 2024
1 parent 67d74ba commit 0e4a584
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 32 deletions.
70 changes: 41 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
#name: Ruby
#
#on:
# push:
# branches:
# - master
#
# pull_request:
#
#jobs:
# build:
# runs-on: ubuntu-latest
# name: Ruby ${{ matrix.ruby }}
# strategy:
# matrix:
# ruby:
# - '3.1.3'
#
# steps:
# - uses: actions/checkout@v4
# - name: Set up Ruby & Rust
# uses: oxidize-rb/actions/setup-ruby-and-rust@v1
# with:
# ruby-version: ${{ matrix.ruby }}
# bundler-cache: true
# cargo-cache: true
# rubygems: '3.4.22'
# - name: Run the default task
# run: bundle exec rake
name: Main

on:
push:
branches:
- master
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v3
- name: Up docker
run: docker compose up -d ruby-rust
- name: bundle install
run: docker compose exec ruby-rust /bin/bash -c 'bundle install'
- name: Check rubocop
run: docker compose exec ruby-rust /bin/bash -c 'bundle exec rake rubocop'
- name: Check syntax tree
run: docker compose exec ruby-rust /bin/bash -c 'bundle exec rake stree:check'
- name: Check Rust
run: docker compose exec ruby-rust /bin/bash -c 'cargo clippy'
test-ruby:
runs-on: ubuntu-latest
name: Ruby-${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
ruby:
- '3.0.2'
- '3.1.4'
- '3.2.2'
- '3.3.0'
steps:
- uses: actions/checkout@v3
- name: Up docker
run: RUBY_VERSION=${{ matrix.ruby }} docker compose up -d ruby-rust
- name: Run Tests
run: docker compose exec ruby-rust /bin/bash -c 'bundle install && bundle exec rake compile && bundle exec rake spec'
3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ services:
build:
context: .
args:
- RUBY_VERSION=${RUBY_VERSION:-3.0.4}
command: "/bin/bash -c 'bundle install && /bin/bash'"
- RUBY_VERSION=${RUBY_VERSION:-3.0.2}
tty: true
volumes:
- ./:/app/
2 changes: 1 addition & 1 deletion sql_insight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = 'Ruby bindings for the sql-insight, a toolkit for SQL query analysis and transformation supporting various SQL dialects'
spec.homepage = 'https://github.com/takaebato/sql-insight-rb'
spec.license = 'MIT'
spec.required_ruby_version = '>= 3.0.4'
spec.required_ruby_version = '>= 3.0.2'
spec.required_rubygems_version = '>= 3.3.11'

spec.metadata['allowed_push_host'] = "TODO: Set to your gem server 'https://example.com'"
Expand Down

0 comments on commit 0e4a584

Please sign in to comment.