mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-04-22 16:06:36 +02:00
use Octokit client to download buildx
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
c252a3bb80
commit
7c965aebec
12 changed files with 200 additions and 18 deletions
|
@ -221,7 +221,7 @@ describe('install', () => {
|
|||
])(
|
||||
'acquires %p of buildx (standalone: %p)',
|
||||
async (version, standalone) => {
|
||||
const buildxBin = await buildx.install(version, tmpDir, standalone);
|
||||
const buildxBin = await buildx.install(version, process.env.GITHUB_TOKEN || '', tmpDir, standalone);
|
||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||
},
|
||||
100000
|
||||
|
|
|
@ -3,14 +3,18 @@ import * as github from '../src/github';
|
|||
|
||||
describe('github', () => {
|
||||
it('returns latest buildx GitHub release', async () => {
|
||||
const release = await github.getRelease('latest');
|
||||
const release = await github.getLatestRelease(process.env.GITHUB_TOKEN || '');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns v0.2.2 buildx GitHub release', async () => {
|
||||
const release = await github.getRelease('v0.2.2');
|
||||
const release = await github.getReleaseTag('v0.2.2', process.env.GITHUB_TOKEN || '');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v0.2.2');
|
||||
});
|
||||
|
||||
it('unknown release', async () => {
|
||||
await expect(github.getReleaseTag('foo', process.env.GITHUB_TOKEN || '')).rejects.toThrowError(new Error('Cannot get release foo: HttpError: Not Found'));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue