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 80581be
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-on-pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ 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

- name: Setup git
run: |
Expand Down
38 changes: 25 additions & 13 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,25 @@ 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 }}

- name: Run tests
run: |
bundle install
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 +64,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 +100,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 +132,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 +167,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 80581be

Please sign in to comment.