Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove qq and parallelize build/pack/promote #1035

Merged
merged 18 commits into from Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 79 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

jobs:
tests:
unit-tests:
strategy:
matrix:
node_version: [lts/-1, lts/*, latest]
Expand All @@ -21,10 +21,87 @@ jobs:
- run: yarn nps lint
- run: yarn build
- run: yarn test:unit
publish:
needs: [unit-tests]
strategy:
matrix:
node_version: [lts/-1, lts/*, latest]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- run: yarn install --network-timeout 600000
- run: yarn build
- run: yarn mocha test/integration/publish.test.ts
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
win-build:
needs: [unit-tests]
strategy:
matrix:
node_version: [lts/-1, lts/*, latest]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- run: yarn install --network-timeout 600000
- run: yarn build
- run: |
sudo apt-get update
sudo apt-get install osslsigncode nsis
- run: yarn test:integration
- run: yarn mocha test/integration/win.test.ts
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
mac-build:
needs: [unit-tests]
strategy:
matrix:
node_version: [lts/-1, lts/*, latest]
fail-fast: false
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- run: yarn install --network-timeout 600000
- run: yarn build
- run: yarn mocha test/integration/macos.test.ts
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
deb-build:
needs: [unit-tests]
env:
OCLIF_DEB_PRIVATE_KEY: ${{ secrets.OCLIF_DEB_PRIVATE_KEY }}
strategy:
matrix:
node_version: [lts/-1, lts/*, latest]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- run: yarn install --network-timeout 600000
- run: yarn build
- run: echo -n "$OCLIF_DEB_PRIVATE_KEY" | gpg --import

- run: yarn mocha test/integration/deb.test.ts
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OCLIF_DEB_KEY: ${{ secrets.OCLIF_DEB_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,6 +4,9 @@
/coverage
/coverage.lcov
/lib
/dist
/node_modules
/tmp
/test/tmp
package-lock.json
**/.DS_Store
15 changes: 15 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"skipFiles": ["<node_internals>/**"]
}
]
}
146 changes: 1 addition & 145 deletions package.json
@@ -1,145 +1 @@
{
"name": "oclif",
"description": "oclif: create your own CLI",
"version": "3.2.31",
"author": "Salesforce",
"bin": {
"oclif": "bin/run"
},
"bugs": "https://github.com/oclif/oclif/issues",
"dependencies": {
"@oclif/core": "^1.20.4",
"@oclif/plugin-help": "^5.1.19",
"@oclif/plugin-not-found": "^2.3.7",
"@oclif/plugin-warn-if-update-available": "^2.0.14",
"aws-sdk": "^2.1231.0",
"concurrently": "^7.5.0",
"debug": "^4.3.3",
"find-yarn-workspace-root": "^2.0.0",
"fs-extra": "^8.1",
"github-slugger": "^1.5.0",
"lodash": "^4.17.21",
"normalize-package-data": "^3.0.3",
"qqjs": "^0.3.11",
"semver": "^7.3.8",
"tslib": "^2.3.1",
"yeoman-environment": "^3.11.1",
"yeoman-generator": "^5.6.1",
"yosay": "^2.0.2"
},
"devDependencies": {
"@oclif/plugin-legacy": "^1.2.7",
"@oclif/test": "^2.2.12",
"@types/chai": "^4.3.4",
"@types/execa": "^0.9.0",
"@types/fs-extra": "^9.0",
"@types/lodash": "^4.14.186",
"@types/lodash.template": "^4.5.0",
"@types/mocha": "^8.2.3",
"@types/node": "^14.18.33",
"@types/read-pkg": "^5.1.0",
"@types/semver": "^7.3.13",
"@types/shelljs": "^0.8.11",
"@types/supports-color": "^7.2.1",
"@types/write-json-file": "^3.2.1",
"@types/yeoman-generator": "^5.2.10",
"@types/yosay": "^2.0.1",
"chai": "^4.3.7",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^7.32.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^1.0.2",
"execa": "^0.11.0",
"fancy-test": "^1.4.10",
"globby": "^11.1.0",
"mocha": "^9.2.2",
"npm-run-path": "^4.0.1",
"nps": "^5.10.0",
"shelljs": "^0.8.5",
"shx": "^0.3.4",
"tmp": "^0.2.1",
"ts-node": "^10.7.0",
"typescript": "4.5.5"
},
"resolutions": {
"colors": "1.4.0",
"@oclif/core": "^1.16.1"
},
"overrides": {
"colors": "1.4.0",
"@oclif/core": "^1.16.1"
},
"engines": {
"node": ">=12.0.0"
},
"files": [
".oclif.manifest.json",
"/bin",
"/lib",
"/templates"
],
"homepage": "https://github.com/oclif/oclif",
"keywords": [
"oclif"
],
"license": "MIT",
"main": "lib/index.js",
"oclif": {
"commands": "./lib/commands",
"plugins": [
"@oclif/plugin-help",
"@oclif/plugin-warn-if-update-available",
"@oclif/plugin-not-found"
],
"bin": "oclif",
"dirname": "oclif",
"topicSeparator": " ",
"macos": {
"identifier": "com.oclif.cli"
},
"update": {
"autoupdate": {
"rollout": 50,
"debounce": 60
},
"node": {
"version": "12.12.0"
},
"s3": {
"bucket": "dfc-data-production",
"indexVersionLimit": 20,
"folder": "media/salesforce-cli/oclif-testing",
"acl": " ",
"host": "https://developer.salesforce.com",
"xz": true
}
},
"topics": {
"pack": {
"description": "package an oclif CLI into installable artifacts"
},
"upload": {
"description": "upload installable CLI artifacts to AWS S3"
}
}
},
"repository": "oclif/oclif",
"scripts": {
"build": "shx rm -rf lib && tsc",
"devcli:lint": "eslint . --ext .ts --config .eslintrc",
"devcli:test": "mocha --forbid-only \"test/unit/*.test.ts\"",
"devcli": "yarn build --noEmit && yarn run devcli:test && yarn run devcli:lint",
"lint": "nps lint",
"postpack": "shx rm .oclif.manifest.json",
"posttest": "yarn run lint",
"prepack": "shx rm -rf lib && tsc && bin/dev manifest .",
"test": "nps test && yarn test:unit && yarn test:integration",
"test:integration": "mocha --forbid-only \"test/integration/*.test.ts\"",
"test:unit": "mocha --forbid-only \"test/unit/*.test.ts\"",
"version": "bin/dev readme && git add README.md"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"types": "lib/index.d.ts"
}
{"name":"oclif","description":"oclif: create your own CLI","version":"3.2.31","author":"Salesforce","bin":{"oclif":"bin/run"},"bugs":"https://github.com/oclif/oclif/issues","dependencies":{"@oclif/core":"^1.20.4","@oclif/plugin-help":"^5.1.19","@oclif/plugin-not-found":"^2.3.7","@oclif/plugin-warn-if-update-available":"^2.0.14","aws-sdk":"^2.1231.0","concurrently":"^7.5.0","debug":"^4.3.3","find-yarn-workspace-root":"^2.0.0","fs-extra":"^8.1","github-slugger":"^1.5.0","got":"^11","lodash":"^4.17.21","normalize-package-data":"^3.0.3","semver":"^7.3.8","tslib":"^2.3.1","yeoman-environment":"^3.11.1","yeoman-generator":"^5.6.1","yosay":"^2.0.2"},"devDependencies":{"@oclif/plugin-legacy":"^1.2.7","@oclif/test":"^2.2.12","@types/chai":"^4.3.4","@types/execa":"^0.9.0","@types/fs-extra":"^9.0","@types/lodash":"^4.14.186","@types/lodash.template":"^4.5.0","@types/mocha":"^8.2.3","@types/node":"^14.18.33","@types/read-pkg":"^5.1.0","@types/semver":"^7.3.13","@types/shelljs":"^0.8.11","@types/supports-color":"^7.2.1","@types/write-json-file":"^3.2.1","@types/yeoman-generator":"^5.2.10","@types/yosay":"^2.0.1","chai":"^4.3.7","conventional-changelog-cli":"^2.2.2","eslint":"^7.32.0","eslint-config-oclif":"^4.0.0","eslint-config-oclif-typescript":"^1.0.2","execa":"^0.11.0","fancy-test":"^1.4.10","globby":"^11.1.0","mocha":"^9.2.2","npm-run-path":"^4.0.1","nps":"^5.10.0","shelljs":"^0.8.5","shx":"^0.3.4","tmp":"^0.2.1","ts-node":"^10.7.0","typescript":"4.5.5"},"resolutions":{"colors":"1.4.0"},"overrides":{"colors":"1.4.0"},"engines":{"node":">=12.0.0"},"files":[".oclif.manifest.json","/bin","/lib","/templates"],"homepage":"https://github.com/oclif/oclif","keywords":["oclif"],"license":"MIT","main":"lib/index.js","oclif":{"commands":"./lib/commands","plugins":["@oclif/plugin-help","@oclif/plugin-warn-if-update-available","@oclif/plugin-not-found"],"bin":"oclif","dirname":"oclif","topicSeparator":" ","macos":{"identifier":"com.oclif.cli"},"update":{"autoupdate":{"rollout":50,"debounce":60},"node":{"version":"16.13.2"},"s3":{"bucket":"dfc-data-production","indexVersionLimit":20,"folder":"media/salesforce-cli/oclif-testing","acl":" ","host":"https://developer.salesforce.com","xz":true}},"topics":{"pack":{"description":"package an oclif CLI into installable artifacts"},"upload":{"description":"upload installable CLI artifacts to AWS S3"}}},"repository":"oclif/oclif","scripts":{"build":"shx rm -rf lib && tsc","devcli:lint":"eslint . --ext .ts --config .eslintrc","devcli:test":"mocha --forbid-only \"test/unit/*.test.ts\"","devcli":"yarn build --noEmit && yarn run devcli:test && yarn run devcli:lint","lint":"nps lint","postpack":"shx rm .oclif.manifest.json","posttest":"yarn run lint","prepack":"shx rm -rf lib && tsc && bin/dev manifest .","test":"nps test && yarn test:unit && yarn test:integration","test:integration":"mocha --forbid-only \"test/integration/*.test.ts\"","test:unit":"mocha --forbid-only \"test/unit/*.test.ts\"","version":"bin/dev readme && git add README.md"},"publishConfig":{"registry":"https://registry.npmjs.org"},"types":"lib/index.d.ts"}
RodEsp marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions src/aws.ts
@@ -1,9 +1,9 @@
import * as CloudFront from 'aws-sdk/clients/cloudfront'
import * as S3 from 'aws-sdk/clients/s3'
import * as fs from 'fs-extra'
import * as qq from 'qqjs'

import {debug as Debug, log} from './log'
import {prettifyPaths} from './util'

const debug = Debug.new('aws')

Expand Down Expand Up @@ -65,7 +65,7 @@ export default {
get s3() {
return {
uploadFile: (local: string, options: S3.Types.PutObjectRequest) => new Promise((resolve, reject) => {
log('s3:uploadFile', qq.prettifyPaths(local), `s3://${options.Bucket}/${options.Key}`)
log('s3:uploadFile', prettifyPaths(local), `s3://${options.Bucket}/${options.Key}`)
options.Body = fs.createReadStream(local)
aws.s3.upload(options, err => {
if (err) reject(err)
Expand Down