1
0
Fork 0
mirror of https://github.com/docker/build-push-action.git synced 2025-04-22 14:46:39 +02:00

Check Buildx version

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-23 03:31:38 +02:00
parent f11192a27b
commit 3e57a3300a
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
7 changed files with 2241 additions and 13 deletions

View file

@ -1,4 +1,5 @@
import fs from 'fs';
import * as semver from 'semver';
import * as buildx from '../src/buildx';
const digest = 'sha256:bfb45ab72e46908183546477a08f8867fc40cebadd00af54b071b097aed127a9';
@ -13,3 +14,20 @@ describe('getImageID', () => {
expect(imageID).toEqual(digest);
});
});
describe('getVersion', () => {
it('valid', async () => {
const version = await buildx.getVersion();
console.log(`version: ${version}`);
expect(semver.valid(version)).not.toBeNull();
}, 100000);
});
describe('parseVersion', () => {
test.each([
['github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
['github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2', '0.4.2']
])('given %p', async (stdout, expected) => {
expect(await buildx.parseVersion(stdout)).toEqual(expected);
});
});