diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..9c4af5238 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,135 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: CI + +on: push + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: '14.x' + cache: yarn + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Lint + run: yarn lint + + test-libs: + name: Test - core, schema, legacy-scripting-runner + runs-on: ubuntu-latest + environment: ci + env: + ZAPIER_DEPLOY_KEY: ${{ secrets.ZAPIER_DEPLOY_KEY }} + TEST_APP_ID: ${{ secrets.TEST_APP_ID }} + + strategy: + matrix: + node-version: [12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Test - core + run: yarn test + working-directory: packages/core + - name: Test - schema + run: yarn test + working-directory: packages/schema + - name: Test - legacy-scripting-runner + run: yarn test + working-directory: packages/legacy-scripting-runner + + test-cli: + name: Test - cli + runs-on: ${{ matrix.os }} + environment: ci + env: + ZAPIER_DEPLOY_KEY: ${{ secrets.ZAPIER_DEPLOY_KEY }} + TEST_APP_ID: ${{ secrets.TEST_APP_ID }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + node-version: [12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Test - cli + run: yarn test + working-directory: packages/cli + + smoke-test-libs: + name: Smoke test - core, schema + runs-on: ubuntu-latest + environment: ci + env: + ZAPIER_DEPLOY_KEY: ${{ secrets.ZAPIER_DEPLOY_KEY }} + TEST_APP_ID: ${{ secrets.TEST_APP_ID }} + + strategy: + matrix: + node-version: [12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Smoke test - core + run: yarn smoke-test + working-directory: packages/core + - name: Smoke test - schema + run: yarn smoke-test + working-directory: packages/schema + + smoke-test-cli: + name: Smoke test - cli + runs-on: ${{ matrix.os }} + + environment: ci + env: + ZAPIER_DEPLOY_KEY: ${{ secrets.ZAPIER_DEPLOY_KEY }} + TEST_APP_ID: ${{ secrets.TEST_APP_ID }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + node-version: [12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Smoke test - cli + run: yarn smoke-test + working-directory: packages/cli diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b96c7cd97..000000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: node_js -node_js: - - "14" -cache: - - npm: true - - yarn: true - - pip: true -before_install: - - npm install -g yarn - - pip install --user awscli -install: - - yarn install -stages: - - name: "Test" - - name: "Deploy" - if: tag IS present -jobs: - include: - - stage: "Test" - name: "lint" - script: "yarn lint" - node_js: "14" - - name: "unit tests - Node 12" - script: "yarn test" - node_js: "12" - - name: "unit tests - Node 14" - script: "yarn test" - node_js: "14" - - name: "smoke tests - Node 12" - script: "yarn smoke-test" - node_js: "12" - - name: "smoke tests - Node 14" - script: "yarn smoke-test" - node_js: "14" -notifications: - email: false -env: - global: - - PATH: PATH=$HOME/.local/bin:$PATH diff --git a/package.json b/package.json index 7ae797436..23cc1493a 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "private": true, "devDependencies": { "chalk": "^4.1.1", + "cross-env": "^7.0.3", "eslint": "^7.26.0", "eslint-config-prettier": "^8.3.0", "eslint-config-standard": "^16.0.2", diff --git a/packages/cli/package.json b/packages/cli/package.json index 7c23069f0..9c8a4eac9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -31,8 +31,8 @@ "postversion": "git push && git push --tags", "lint": "eslint src snippets", "lint:fix": "eslint --fix src snippets", - "test": "NODE_ENV=test mocha -t 50000 --recursive src/tests", - "smoke-test": "NODE_ENV=test mocha -t 120000 --recursive src/smoke-tests", + "test": "cross-env NODE_ENV=test mocha -t 50000 --recursive src/tests", + "smoke-test": "cross-env NODE_ENV=test mocha -t 120000 --recursive src/smoke-tests", "validate-templates": "./scripts/validate-app-templates.js", "set-template-versions": "./scripts/set-app-template-versions.js", "validate": "yarn test && yarn smoke-test && yarn lint" diff --git a/yarn.lock b/yarn.lock index 2020b6069..8f600ce7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3310,6 +3310,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -3330,7 +3337,7 @@ cross-spawn@^7.0.0: shebang-command "^2.0.0" which "^2.0.1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -7038,6 +7045,7 @@ minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.3.tgz#34c7cea038c817a8658461bf35174551dce17a0a" integrity sha512-akCrLDWfbdAWkMLBxJEeWTdNsjML+dt5YgOI4gJ53vuO0vrmYQkUPxa6j6V65s9CcePIr2SSWqjT2EcrNseryQ== dependencies: + encoding "^0.1.12" minipass "^3.1.0" minipass-sized "^1.0.3" minizlib "^2.0.0"