From fb010ad223b5937716045ae68c9e9400aadfe2c0 Mon Sep 17 00:00:00 2001 From: armandfardeau Date: Sat, 1 Jul 2023 03:01:08 +0200 Subject: [PATCH] Add workflows --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .rubocop.yml | 1 + Gemfile.lock | 6 ++++++ 3 files 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 0000000..87b968c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: Ruby Gem + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Rubocop + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + bundler-cache: true + - name: Lint + run: bundle exec rubocop -P + tests: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + ruby_version: ['2.7', '3.0', '3.1', "3.2"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby 2.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby_version }} + bundler-cache: true + - name: Run tests + run: bundle exec rspec diff --git a/.rubocop.yml b/.rubocop.yml index 8771aca..3b12a56 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ require: rubocop-rspec AllCops: Exclude: - "*.gemspec" + - "vendor/bundle/**/*" # https://github.com/rubocop/rubocop/issues/9832#issuecomment-882111229 NewCops: enable Style/StringLiterals: diff --git a/Gemfile.lock b/Gemfile.lock index f5f175b..607e7b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,6 +47,10 @@ GEM racc (~> 1.4) nokogiri (1.15.2-arm64-darwin) racc (~> 1.4) + nokogiri (1.15.2-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.2-x86_64-linux) + racc (~> 1.4) oauth2 (1.4.8) faraday (>= 0.8, < 3.0) jwt (>= 1.0, < 3.0) @@ -122,6 +126,8 @@ GEM PLATFORMS aarch64-linux arm64-darwin-21 + x86_64-darwin-20 + x86_64-linux DEPENDENCIES bundler (~> 2.4)