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 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`); 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(