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 1, 2023
1 parent da04c87 commit 893e44e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 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
34 changes: 21 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
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']
steps:

- uses: actions/checkout@v3
Expand All @@ -17,23 +23,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 }}

- 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']

steps:
- uses: actions/checkout@v3
Expand All @@ -54,10 +61,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 +97,17 @@ 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']

steps:
- uses: actions/checkout@v3
Expand All @@ -120,10 +128,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 +163,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

0 comments on commit 893e44e

Please sign in to comment.