-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #601 from crazy-max/standalone-mode
Standalone mode support
- Loading branch information
Showing
10 changed files
with
152 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {describe, expect, it, jest} from '@jest/globals'; | ||
import * as docker from '../src/docker'; | ||
import * as exec from '@actions/exec'; | ||
|
||
describe('isAvailable', () => { | ||
it('cli', () => { | ||
const execSpy = jest.spyOn(exec, 'getExecOutput'); | ||
docker.isAvailable(); | ||
|
||
// eslint-disable-next-line jest/no-standalone-expect | ||
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, { | ||
silent: true, | ||
ignoreReturnCode: true | ||
}); | ||
}); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as exec from '@actions/exec'; | ||
|
||
export async function isAvailable(): Promise<boolean> { | ||
return await exec | ||
.getExecOutput('docker', undefined, { | ||
ignoreReturnCode: true, | ||
silent: true | ||
}) | ||
.then(res => { | ||
if (res.stderr.length > 0 && res.exitCode != 0) { | ||
return false; | ||
} | ||
return res.exitCode == 0; | ||
}) | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
.catch(error => { | ||
return false; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters