Compare commits

..

15 Commits

Author SHA1 Message Date
semantic-release-bot
d6c3a916ee chore(release): 1.0.2 [skip ci]
## [1.0.2](https://github.com/KengoTODA/actions-setup-docker-compose/compare/v1.0.1...v1.0.2) (2021-09-01)

### Bug Fixes

* Add `docker-compose` to PATH ([#274](https://github.com/KengoTODA/actions-setup-docker-compose/issues/274)) ([ecd3566](ecd3566c81))
2021-09-01 02:30:38 +00:00
Tibo Delor
ecd3566c81 fix: Add docker-compose to PATH (#274)
* Expose command as `docker-compose`

* Format and package
2021-09-01 10:29:50 +08:00
dependabot[bot]
f73439ca62 chore(deps-dev): bump @types/node from 16.7.7 to 16.7.9
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.7 to 16.7.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 17:43:35 +00:00
dependabot[bot]
bf955761b2 chore(deps-dev): bump @typescript-eslint/parser from 4.29.3 to 4.30.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.3 to 4.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.30.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 17:17:44 +00:00
dependabot[bot]
98bf7786db chore(deps-dev): bump @types/node from 16.7.3 to 16.7.7
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.3 to 16.7.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 17:08:00 +00:00
dependabot[bot]
42a7ee2bf3 chore(deps-dev): bump @vercel/ncc from 0.29.2 to 0.30.0
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.29.2 to 0.30.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.29.2...0.30.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 17:05:29 +00:00
Kengo TODA
3268a385e5 chore: treat caught error as unknown 2021-08-29 06:39:28 +00:00
dependabot[bot]
c0bf818478 chore(deps-dev): bump typescript from 4.3.5 to 4.4.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.5...v4.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-29 06:39:28 +00:00
dependabot[bot]
61f4c9c927 chore(deps-dev): bump @types/node from 16.7.2 to 16.7.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.2 to 16.7.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-27 17:04:54 +00:00
dependabot[bot]
7be9d34ace chore(deps-dev): bump jest from 27.0.6 to 27.1.0
Bumps [jest](https://github.com/facebook/jest) from 27.0.6 to 27.1.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.0.6...v27.1.0)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-27 17:04:22 +00:00
dependabot[bot]
06c58cac8f chore(deps-dev): bump @types/node from 16.7.1 to 16.7.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.1 to 16.7.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 18:04:50 +00:00
dependabot[bot]
15706adc71 chore(deps-dev): bump semantic-release from 17.4.6 to 17.4.7
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.4.6 to 17.4.7.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.4.6...v17.4.7)

---
updated-dependencies:
- dependency-name: semantic-release
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 17:24:12 +00:00
dependabot[bot]
0050aaf8ea chore(deps-dev): bump semantic-release from 17.4.5 to 17.4.6
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.4.5 to 17.4.6.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.4.5...v17.4.6)

---
updated-dependencies:
- dependency-name: semantic-release
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-24 17:09:13 +00:00
dependabot[bot]
4b20200534 chore(deps-dev): bump @typescript-eslint/parser from 4.29.2 to 4.29.3
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.2 to 4.29.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.3/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-24 17:06:55 +00:00
dependabot[bot]
c29f440249 chore(deps-dev): bump @types/node from 16.6.2 to 16.7.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.6.2 to 16.7.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 17:06:51 +00:00
7 changed files with 1340 additions and 532 deletions

View File

@@ -1,7 +1,21 @@
import {runCommand} from '../src/install'
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')
})

13
dist/index.js vendored
View File

@@ -22,7 +22,7 @@ const exec_1 = __nccwpck_require__(514);
function runCommand(command) {
return __awaiter(this, void 0, void 0, function* () {
let output = '';
const result = yield exec_1.exec(command, [], {
const result = yield (0, exec_1.exec)(command, [], {
listeners: {
stdout: (data) => {
output += data.toString();
@@ -41,9 +41,10 @@ function installOnLinux(version) {
const system = runCommand('uname -s');
const hardware = runCommand('uname -m');
const url = `https://github.com/docker/compose/releases/download/${version}/docker-compose-${yield system}-${yield hardware}`;
const installerPath = yield tool_cache_1.downloadTool(url);
yield exec_1.exec(`chmod +x ${installerPath}`);
return installerPath;
const installerPath = yield (0, tool_cache_1.downloadTool)(url);
yield (0, exec_1.exec)(`chmod +x ${installerPath}`);
const cachedPath = yield (0, tool_cache_1.cacheFile)(installerPath, 'docker-compose', 'docker-compose', version);
return cachedPath;
});
}
function install(version) {
@@ -103,11 +104,11 @@ function run() {
const version = core.getInput('version', {
required: true
});
const commandPath = yield install_1.install(version);
const commandPath = yield (0, install_1.install)(version);
core.addPath(commandPath);
}
catch (error) {
core.setFailed(error.message);
core.setFailed(error instanceof Error ? error.message : 'Unknown error');
}
});
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

1825
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@kengotoda/actions-setup-docker-compose",
"version": "1.0.1",
"version": "1.0.2",
"description": "the GitHub Action setting up docker-compose command",
"main": "lib/main.js",
"private": false,
@@ -37,7 +37,7 @@
"@semantic-release/git": "^9.0.0",
"@types/node": "^16.3.2",
"@typescript-eslint/parser": "^4.28.3",
"@vercel/ncc": "^0.29.0",
"@vercel/ncc": "^0.30.0",
"eslint": "^7.30.0",
"eslint-plugin-github": "^4.1.3",
"eslint-plugin-jest": "^24.3.6",

View File

@@ -1,4 +1,4 @@
import {downloadTool} from '@actions/tool-cache'
import {cacheFile, downloadTool} from '@actions/tool-cache'
import {exec} from '@actions/exec'
export async function runCommand(command: string): Promise<string> {
@@ -22,7 +22,13 @@ async function installOnLinux(version: string): Promise<string> {
const url = `https://github.com/docker/compose/releases/download/${version}/docker-compose-${await system}-${await hardware}`
const installerPath = await downloadTool(url)
await exec(`chmod +x ${installerPath}`)
return installerPath
const cachedPath = await cacheFile(
installerPath,
'docker-compose',
'docker-compose',
version
)
return cachedPath
}
export async function install(version: string): Promise<string> {

View File

@@ -9,7 +9,7 @@ async function run(): Promise<void> {
const commandPath = await install(version)
core.addPath(commandPath)
} catch (error) {
core.setFailed(error.message)
core.setFailed(error instanceof Error ? error.message : 'Unknown error')
}
}