Skip to content

Commit

Permalink
Fix/use public ip input (#308)
Browse files Browse the repository at this point in the history
Corrected the functionality of the `public-ip` parameter. Its value is now properly considered. The default value is `true` to maintain backward compatibility. 

Added the `runner-version` parameter, which allows specifying the version of the runner to be installed. The default value is `2.299.1` to ensure backward compatibility of the action.
  • Loading branch information
nikolaymatrosov authored Jun 20, 2024
1 parent f145986 commit 4ff639f
Show file tree
Hide file tree
Showing 10 changed files with 627 additions and 1,534 deletions.
6 changes: 6 additions & 0 deletions __tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test('basic Config ', () => {
diskType: 'diskType',
diskSize: 10 * 1024 ** 3,
subnetId: 'subnetId',
publicIp: true,
zoneId: 'zoneId',
platformId: 'platformId',
folderId: 'folderId',
Expand All @@ -23,6 +24,7 @@ test('basic Config ', () => {
secondDiskSize: 0,
user: '',
sshPublicKey: '',
runnerVersion: '2.299.1',
resourcesSpec: {
cores: 1,
memory: 10 * 1024 ** 3,
Expand All @@ -40,6 +42,7 @@ test('add secondary disk', () => {
diskType: 'diskType',
diskSize: parseMemory('256Gb'),
subnetId: 'subnetId',
publicIp: true,
zoneId: 'zoneId',
platformId: 'platformId',
folderId: 'folderId',
Expand All @@ -53,6 +56,7 @@ test('add secondary disk', () => {
secondDiskSize: parseMemory('30Gb'),
user: '',
sshPublicKey: '',
runnerVersion: '2.299.1',
resourcesSpec: {
cores: 1,
memory: parseMemory('8Gb'),
Expand All @@ -70,6 +74,7 @@ test('add secondary disk without image-id throw error', () => {
diskType: 'diskType',
diskSize: parseMemory('256Gb'),
subnetId: 'subnetId',
publicIp: true,
zoneId: 'zoneId',
platformId: 'platformId',
folderId: 'folderId',
Expand All @@ -83,6 +88,7 @@ test('add secondary disk without image-id throw error', () => {
secondDiskSize: parseMemory('30Gb'),
user: 'user',
sshPublicKey: 'sshPublicKey',
runnerVersion: '2.299.1',
resourcesSpec: {
cores: 1,
memory: parseMemory('8Gb'),
Expand Down
6 changes: 5 additions & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {describe, test, expect} from '@jest/globals';
import {describe, expect, test} from '@jest/globals';
import * as cp from 'child_process';
import * as path from 'path';
import * as process from 'process';
Expand Down Expand Up @@ -34,6 +34,7 @@ describe('cloud-init', () => {
runnerHomeDir: '',
user: '',
sshPublicKey: '',
runnerVersion: '2.299.1',
});
expect(actual.length).toBe(8);
expect(actual).toMatchSnapshot();
Expand All @@ -49,6 +50,7 @@ describe('cloud-init', () => {
runnerHomeDir: 'foo',
user: '',
sshPublicKey: '',
runnerVersion: '2.299.1',
});
expect(actual.length).toBe(5);
expect(actual).toMatchSnapshot();
Expand All @@ -64,6 +66,7 @@ describe('cloud-init', () => {
runnerHomeDir: '',
user: 'user',
sshPublicKey: 'key',
runnerVersion: '2.299.1',
});
expect(actual.length).toBe(23);
expect(actual).toMatchSnapshot();
Expand All @@ -79,6 +82,7 @@ describe('cloud-init', () => {
runnerHomeDir: 'foo',
user: 'user',
sshPublicKey: 'key',
runnerVersion: '2.299.1',
});
expect(actual.length).toBe(16);
expect(actual).toMatchSnapshot();
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,15 @@ inputs:
public-ip:
required: false
description: 'Public IP address'
default: 'true'
platform-id:
required: false
description: 'Compute platform Id'
default: 'standard-v3'
runner-version:
required: false
description: 'Version of the actions-runner software'
default: '2.299.1'

user:
required: false
Expand Down
Loading

0 comments on commit 4ff639f

Please sign in to comment.