Skip to content

Commit e867b6c

Browse files
committed
Limit action to ubuntu virt env.
1 parent d28653a commit e867b6c

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
with:
99
dfx-version: 0.7.1
1010
vessel-version: 0.6.1
11-
- run: dfx --version
12-
- run: moc --version
13-
- run: vessel --version
11+
- run: |
12+
dfx --version
13+
moc --version
14+
vessel --version

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
This action sets up a dfx environment, also includes `moc`.
44

5+
**!** Only supports Ubuntu virtual environments.
6+
57
## Usage
68

79
```yml
10+
runs-on: ubuntu-latest
811
steps:
912
- uses: actions/checkout@v2
1013
- uses: allusion-be/setup-dfx@main
1114
with:
1215
dfx-version: 0.7.1
16+
vessel-version: 0.6.1
1317
- run: |
1418
dfx --version
1519
moc --version
20+
vessel --version
1621
```
1722
1823
## Possible Improvements

dist/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ exports.run = void 0;
4242
const core = __importStar(__nccwpck_require__(186));
4343
const io = __importStar(__nccwpck_require__(436));
4444
const child_process_1 = __importDefault(__nccwpck_require__(129));
45+
const os_1 = __importDefault(__nccwpck_require__(87));
4546
function run() {
4647
return __awaiter(this, void 0, void 0, function* () {
48+
if (os_1.default.platform() !== 'linux') {
49+
core.setFailed(`Action not supported for: ${os_1.default.platform()} ${os_1.default.arch()}.`);
50+
return;
51+
}
4752
try {
4853
let dfxVersion = core.getInput('dfx-version');
4954
core.info(`Setup dfx version ${dfxVersion}`);

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import * as core from '@actions/core';
22
import * as io from '@actions/io';
33
import cp from 'child_process';
4+
import os from 'os';
45

56
export async function run() {
7+
if (os.platform() !== 'linux') {
8+
core.setFailed(`Action not supported for: ${os.platform()} ${os.arch()}.`)
9+
return;
10+
}
11+
612
try {
713
let dfxVersion = core.getInput('dfx-version');
814
core.info(`Setup dfx version ${dfxVersion}`);

0 commit comments

Comments
 (0)