* System naming for docker-compose >= 2.0 fixed As you might notice they started naming releases using not capitalized system name starting from `docker-compose` v2.0.0 ([ref](https://github.com/docker/compose/releases/tag/v2.0.0)). This commit adds version check and fixes system name (returned by `uname -s`). * Update src/install.ts Co-authored-by: Kengo TODA <skypencil+github@gmail.com> * Version Naming for later versions updated * Parsing instead of lexicographical order applied * Update src/install.ts Co-authored-by: Kengo TODA <skypencil+github@gmail.com> * Tests for new release naming added * Integration test for versions > 2.0.0 added * Version tag for releases >= 2.0.0 fixed * Indentation restored * js files compiled * auto-appending 'v' added Co-authored-by: Kengo TODA <skypencil+github@gmail.com>
23 lines
612 B
TypeScript
23 lines
612 B
TypeScript
import {install, runCommand} from '../src/install'
|
|
import * as core from '@actions/core'
|
|
|
|
import {expect, test} from '@jest/globals'
|
|
|
|
test('runCommand', async () => {
|
|
const result = await runCommand('echo foo bar')
|
|
expect(result).toBe('foo bar')
|
|
})
|
|
|
|
async function testVersion(version: string) {
|
|
const commandPath = await install(version)
|
|
core.addPath(commandPath)
|
|
const result = await runCommand('docker-compose version')
|
|
expect(result).toContain(version)
|
|
}
|
|
|
|
test('Install the right version', async () => {
|
|
await testVersion('1.29.1')
|
|
await testVersion('1.29.2')
|
|
await testVersion('2.2.3')
|
|
})
|