From e867b6c851c181449cae41fa18dda5064dd4453e Mon Sep 17 00:00:00 2001 From: Quint Daenen Date: Tue, 8 Jun 2021 17:03:04 +0200 Subject: [PATCH] Limit action to ubuntu virt env. --- .github/workflows/main.yml | 7 ++++--- README.md | 5 +++++ dist/index.js | 5 +++++ src/main.ts | 6 ++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 963e5a1..c087ecb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ jobs: with: dfx-version: 0.7.1 vessel-version: 0.6.1 - - run: dfx --version - - run: moc --version - - run: vessel --version + - run: | + dfx --version + moc --version + vessel --version diff --git a/README.md b/README.md index 05fb9a1..3253b9a 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,22 @@ This action sets up a dfx environment, also includes `moc`. +**!** Only supports Ubuntu virtual environments. + ## Usage ```yml +runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: allusion-be/setup-dfx@main with: dfx-version: 0.7.1 + vessel-version: 0.6.1 - run: | dfx --version moc --version + vessel --version ``` ## Possible Improvements diff --git a/dist/index.js b/dist/index.js index 9cf0fb7..6d23cf4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -42,8 +42,13 @@ exports.run = void 0; const core = __importStar(__nccwpck_require__(186)); const io = __importStar(__nccwpck_require__(436)); const child_process_1 = __importDefault(__nccwpck_require__(129)); +const os_1 = __importDefault(__nccwpck_require__(87)); function run() { return __awaiter(this, void 0, void 0, function* () { + if (os_1.default.platform() !== 'linux') { + core.setFailed(`Action not supported for: ${os_1.default.platform()} ${os_1.default.arch()}.`); + return; + } try { let dfxVersion = core.getInput('dfx-version'); core.info(`Setup dfx version ${dfxVersion}`); diff --git a/src/main.ts b/src/main.ts index 7fcf84e..077fa54 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,14 @@ import * as core from '@actions/core'; import * as io from '@actions/io'; import cp from 'child_process'; +import os from 'os'; export async function run() { + if (os.platform() !== 'linux') { + core.setFailed(`Action not supported for: ${os.platform()} ${os.arch()}.`) + return; + } + try { let dfxVersion = core.getInput('dfx-version'); core.info(`Setup dfx version ${dfxVersion}`);