mirror of
https://github.com/docker/build-push-action.git
synced 2024-11-16 08:53:50 +08:00
26b3a3b0cd
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import fs = require('fs');
|
|
import * as buildx from '../src/buildx';
|
|
import * as path from 'path';
|
|
import * as os from 'os';
|
|
|
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
|
|
|
|
describe('buildx', () => {
|
|
it('is available', async () => {
|
|
expect(await buildx.isAvailable()).toBe(true);
|
|
});
|
|
|
|
it('count builders', async () => {
|
|
const countBuilders = await buildx.countBuilders();
|
|
console.log(`countBuilders: ${countBuilders}`);
|
|
expect(countBuilders).toBeGreaterThan(0);
|
|
});
|
|
|
|
it('platforms', async () => {
|
|
const platforms = await buildx.platforms();
|
|
console.log(`platforms: ${platforms}`);
|
|
expect(platforms).not.toBeUndefined();
|
|
expect(platforms).not.toEqual('');
|
|
});
|
|
|
|
it('acquires v0.2.2 version of buildx', async () => {
|
|
const buildxBin = await buildx.install('v0.2.2', tmpDir);
|
|
console.log(buildxBin);
|
|
expect(fs.existsSync(buildxBin)).toBe(true);
|
|
}, 100000);
|
|
|
|
it('acquires latest version of buildx', async () => {
|
|
const buildxBin = await buildx.install('latest', tmpDir);
|
|
console.log(buildxBin);
|
|
expect(fs.existsSync(buildxBin)).toBe(true);
|
|
}, 100000);
|
|
});
|