Skip to content

Commit

Permalink
Run tests against multiple Ruby versions
Browse files Browse the repository at this point in the history
Signed-off-by: Chad Wilson <[email protected]>
  • Loading branch information
chadlwilson committed Jul 5, 2023
1 parent 7c7bbae commit ced3a0b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 24 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release-on-pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ jobs:
RUBYGEMS_PASS: '${{ secrets.RUBYGEMS_PASS }}'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.7.x
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
bundler-cache: true

- name: Setup git
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: create packages
run: |
bundle install
bundle exec rake package_all
run: bundle exec rake package_all

- name: Release on github
run: |
Expand Down
43 changes: 27 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
name: tests

on: [push, pull_request]

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
name: Run test on ${{ matrix.os }}
name: Run UTs on ${{ matrix.ruby_version }} + ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby_version: ['2.7', '3.0', '3.1', '3.2']
fail-fast: false

steps:

- uses: actions/checkout@v3
Expand All @@ -17,23 +25,24 @@ jobs:
run: |
node -e "console.log(JSON.stringify(process.env, null, ' '))"
- name: Set up Ruby 2.7.x
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true

- name: Run tests
run: |
bundle install
bundle exec rake spec
run: bundle exec rake spec

fts:
name: Run FTs on ${{ matrix.os }}
name: Run FTs on ${{ matrix.ruby_version }} + ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: tests
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
ruby_version: ['2.7', '3.0', '3.1', '3.2']
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand All @@ -54,10 +63,10 @@ jobs:
echo "RUBY_PLUGIN_BRANCH=$COMMIT_HASH" >> $GITHUB_ENV
echo "LOCAL_RUBY_PLUGIN_PATH=$(pwd)" >> $GITHUB_ENV
- name: Set up Ruby 2.7.x
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: ${{ matrix.ruby_version }}

- name: Setup go 1.20.x
uses: actions/setup-go@v4
Expand Down Expand Up @@ -90,16 +99,18 @@ jobs:
- uses: actions/upload-artifact@master
if: failure() || cancelled()
with:
name: fts-logs-${{ matrix.os }}
name: fts-logs-${{ matrix.os }}-ruby-${{ matrix.ruby_version }}
path: gauge-tests/logs

lsp-tests:
name: Run lsp on ${{ matrix.os }}
name: Run lsp on ${{ matrix.ruby_version }} + ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby_version: ['2.7', '3.0', '3.1', '3.2']
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand All @@ -120,10 +131,10 @@ jobs:
echo "RUBY_PLUGIN_BRANCH=$COMMIT_HASH" >> $GITHUB_ENV
echo "LOCAL_RUBY_PLUGIN_PATH=$(pwd)" >> $GITHUB_ENV
- name: Set up Ruby 2.7.x
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: ${{ matrix.ruby_version }}

- name: Setup go 1.20.x
uses: actions/setup-go@v4
Expand Down Expand Up @@ -155,5 +166,5 @@ jobs:
- uses: actions/upload-artifact@master
if: failure() || cancelled()
with:
name: lsp-logs-${{ matrix.os }}
name: lsp-logs-${{ matrix.os }}-ruby-${{ matrix.ruby_version }}
path: gauge-lsp-tests/logs
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.8
3.2.2
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
gauge-ruby (0.6.0)
gauge-ruby (0.7.0)
grpc (~> 1.10, >= 1.10.0)
parser (>= 2.7, < 4.0)
ruby-protocol-buffers (= 1.6.1)
Expand Down
2 changes: 1 addition & 1 deletion ruby.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id" : "ruby",
"version" : "0.6.0",
"version" : "0.7.0",
"description": "ruby support for gauge",
"install": {
"windows": [],
Expand Down

0 comments on commit ced3a0b

Please sign in to comment.