Merge pull request #54 from MSP-Greg/update-format

Update README to refer to '2.6' instead of '2.6.x', add tests for such
This commit is contained in:
Bryan MacFarlane
2020-01-17 20:22:16 -05:00
committed by GitHub
3 changed files with 26 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
version: [2.4.x, 2.5.x, 2.6.x, 2.7.x]
version: [2.4, 2.5.x, 2.6, 2.7.x]
steps:
- name: Checkout
uses: actions/checkout@v2

View File

@@ -6,9 +6,13 @@
<a href="https://github.com/actions/setup-ruby/actions"><img alt="versions status" src="https://github.com/actions/setup-ruby/workflows/ruby-versions/badge.svg"></a>
</p>
This action sets up a ruby environment for versions which are installed on the [Actions Virtual Environments](https://github.com/actions/virtual-environments). Because virtual environments are updated, a workflow should only be bound to a minor versions.
This action sets up a ruby environment for versions which are installed on the [Actions Virtual Environments](https://github.com/actions/virtual-environments).
> Only supports `2.4.x`, `2.5.x`, and `2.6.x`.
Virtual environments contain only one Ruby version within a 'major.minor' release, and are updated with new releases. Hence, a workflow should only be bound to minor versions.
Note that a `ruby-version:` of `2.6` or `2.6.x` are equivalent.
> Supports `2.4`, `2.5`, `2.6`, and `2.7`.
# Usage
@@ -20,7 +24,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6.x' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
ruby-version: '2.6' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
- run: ruby hello.rb
```
@@ -31,7 +35,7 @@ jobs:
runs-on: ubuntu-16.04
strategy:
matrix:
ruby: [ '2.5.x', '2.6.x' ]
ruby: [ '2.5', '2.6' ]
name: Ruby ${{ matrix.ruby }} sample
steps:
- uses: actions/checkout@master
@@ -67,7 +71,7 @@ jobs:
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.6
- name: Build and test with Rake
env:
PGHOST: 127.0.0.1

View File

@@ -35,6 +35,22 @@ describe('find-ruby', () => {
await findRubyVersion('17.0.0');
});
it('Uses 9.0.x version of ruby installed in cache ', async () => {
const rubyDir: string = path.join(toolDir, 'Ruby', '9.0.1', os.arch());
await io.mkdirP(rubyDir);
fs.writeFileSync(`${rubyDir}.complete`, 'hello');
// This will throw if it doesn't find it in the cache (because no such version exists)
await findRubyVersion('9.0.x');
});
it('Uses 9.0 version of ruby installed in cache ', async () => {
const rubyDir: string = path.join(toolDir, 'Ruby', '9.0.1', os.arch());
await io.mkdirP(rubyDir);
fs.writeFileSync(`${rubyDir}.complete`, 'hello');
// This will throw if it doesn't find it in the cache (because no such version exists)
await findRubyVersion('9.0');
});
it('findRubyVersion throws if cannot find any version of ruby', async () => {
let thrown = false;
try {