From 1a1cd9f3ca0ba260c0195b43fadbc78296c0700b Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Sun, 3 May 2020 19:37:39 -0700 Subject: [PATCH 1/3] Fix create-container system tests on Windows --- system-tests/src/tests/misc.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/system-tests/src/tests/misc.js b/system-tests/src/tests/misc.js index 2f2fbd563..3f310baf0 100644 --- a/system-tests/src/tests/misc.js +++ b/system-tests/src/tests/misc.js @@ -133,9 +133,15 @@ run( { expectedExitCode: 1 }, ); +// Escape backslashes on Windows +const miniApp = `file:${ + process.platform === 'win32' + ? miniAppPath.replace(/\\/g, '\\\\') + : miniAppPath +}`; // Container gen should be successful for the two following commands -run(`create-container --miniapps file:${miniAppPath} -p android`); -run(`create-container --miniapps file:${miniAppPath} -p ios --skipInstall`); +run(`create-container --miniapps ${miniApp} -p android`); +run(`create-container --miniapps ${miniApp} -p ios --skipInstall`); // transform-container / publish-container should be successful run( From bfc72cd6df02c0954e66160e3530aff650c7b94c Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Mon, 4 May 2020 13:16:46 -0700 Subject: [PATCH 2/3] Add basic system test --- system-tests/src/tests/basic.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 system-tests/src/tests/basic.js diff --git a/system-tests/src/tests/basic.js b/system-tests/src/tests/basic.js new file mode 100644 index 000000000..add1ab27c --- /dev/null +++ b/system-tests/src/tests/basic.js @@ -0,0 +1,21 @@ +const chalk = require('chalk'); +const path = require('path'); + +const run = require('../utils/run'); + +console.log(chalk.bold.blue(`Working directory: ${process.cwd()}`)); + +const miniAppName = 'BasicMiniApp'; +run(`create-miniapp ${miniAppName} --packageName basic-miniapp --skipNpmCheck --skipInstall`); + +const miniAppPath = path.join(process.cwd(), miniAppName); + +// Escape backslashes on Windows +const miniApp = `file:${ + process.platform === 'win32' + ? miniAppPath.replace(/\\/g, '\\\\') + : miniAppPath +}`; + +run(`create-container -m ${miniApp} -p android`); +run(`create-container -m ${miniApp} -p ios --skipInstall`); From 7f1c3228d5db196353055953cce07f858314e7f0 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Mon, 4 May 2020 13:16:59 -0700 Subject: [PATCH 3/3] Run basic system test on GitHub Actions --- .github/workflows/ci.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21a2f2651..9ee31fb87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ name: ci -on: [push, pull_request] +on: + push: + branches: '*' + pull_request: jobs: build: runs-on: ${{ matrix.os }} @@ -18,7 +21,7 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - - run: yarn + - run: yarn --frozen-lockfile - run: yarn build - run: yarn test:unit lint: @@ -26,5 +29,15 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 - - run: yarn + - run: yarn --frozen-lockfile - run: yarn check:lint + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + - run: yarn --frozen-lockfile + - run: yarn test:system basic