From 65b90030c7181d6d9e3ad8390306990fcb3c713c Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Fri, 3 Nov 2023 11:20:22 -0700 Subject: [PATCH 1/2] Update package.json stuff --- package.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 26b5561..ef5719c 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,23 @@ { + "name": "@aws-lite/benchmarks", + "version": "0.0.0", + "description": "Generates and publishes performance metrics for JavaScript AWS SDKs", + "homepage": "https://github.com/architect/aws-lite-benchmarks", + "repository": { + "type": "git", + "url": "https://github.com/architect/aws-lite-benchmarks" + }, + "bugs": "https://github.com/architect/aws-lite/issues", "scripts": { "bench": "node bench/index.mjs", "lint": "eslint --fix .", - "start": "arc sandbox" + "start": "arc sandbox", + "test": "npm run lint" + }, + "engines": { + "node": ">=16" }, + "license": "Apache-2.0", "dependencies": { "@architect/architect": "^10.16.0", "@architect/eslint-config": "^2.1.2", From a9dac2ae2c5b1ef995f9edd980f524140cdd0d54 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Fri, 3 Nov 2023 11:45:08 -0700 Subject: [PATCH 2/2] Add CI --- .github/code_of_conduct.md | 21 +++++++ .github/contributing.md | 8 +++ .github/pull_request_template.md | 22 ++++++++ .github/workflows/build.yml | 96 ++++++++++++++++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 .github/code_of_conduct.md create mode 100644 .github/contributing.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/build.yml diff --git a/.github/code_of_conduct.md b/.github/code_of_conduct.md new file mode 100644 index 0000000..e48f5c4 --- /dev/null +++ b/.github/code_of_conduct.md @@ -0,0 +1,21 @@ +# Architect Code of Conduct + +We are strongly committed to ensuring the Architect community, and the various online and offline spaces in which its members congregate and collaborate, are safe, positive, inclusive, constructive, and welcoming environments. + +As such, the Architect project adheres to the [OpenJS Foundation Code of Conduct](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md), which itself adheres to the [Contributor Covenant](https://www.contributor-covenant.org). + +Lack of familiarity with this or the OpenJS Foundation Codes of Conduct, or the Contributor covenant, is not an excuse for non-adherence. + + +# Reporting +If you are the subject of any behavior prohibited by this Code of Conduct, or observe someone who is, please contact an Architect team member immediately. + +If you know an Architect team member, you may wish to contact them personally (and you should); but if not, please [contact us via email](mailto:conduct@arc.codes). + +If possible, please attempt to collect any relevant information and evidence, including links, screenshots, or other recordings of any incident. + +Reports will be handled with the utmost care, confidence, and sensitivity towards the individual(s) reporting. + + +# Enforcement +Should incidents arise, upon adjudication those found to be in violation of this Code of Conduct may be immediately expelled from the Architect community, including events, forums, chat workspaces, code repositories, and any other place where Architect community members collaborate. diff --git a/.github/contributing.md b/.github/contributing.md new file mode 100644 index 0000000..6024d63 --- /dev/null +++ b/.github/contributing.md @@ -0,0 +1,8 @@ +# Contributing + +## First: go read the [Architect Code of Conduct](/.github/code_of_conduct.md) + +### Agreement to the Architect Code of Conduct +By participating in and contributing to the Architect community — including, but not limited to its open source projects, any related online venues such as GitHub, Slack, and in-person events, etc. — you agree to the [Architect Code of Conduct](/.github/code_of_conduct.md). + +Lack of familiarity with this Code of Conduct is not an excuse for not adhering to it. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..f10341d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,22 @@ +## Thank you for helping out! ✨ + +### We really appreciate your commitment to improving Architect + +To maintain a high standard of quality in our releases, before merging every pull request we ask that you've completed the following: + +- [ ] Forked the repo and created your branch from `master` +- [ ] Made sure tests pass (run `npm it` from the repo root) +- [ ] Expanded test coverage related to your changes: + - [ ] Added and/or updated unit tests (if appropriate) + - [ ] Added and/or updated integration tests (if appropriate) +- [ ] Updated relevant documentation: + - [ ] Internal to this repo (e.g. `readme.md`, help docs, inline docs & comments, etc.) + - [ ] [Architect docs (arc.codes)](https://github.com/architect/arc.codes) +- [ ] Summarized your changes in `changelog.md` +- [ ] Linked to any related issues, PRs, etc. below that may relate to, consume, or necessitate these changes + +Please also be sure to completed the CLA (if you haven't already). + +Learn more about [contributing to Architect here](https://arc.codes/intro/community). + +Thanks again! diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..55d1828 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,96 @@ +name: Node CI + +# Push tests pushes; PR tests merges +on: [ push, pull_request ] + +defaults: + run: + shell: bash + +jobs: + # Test the build + build: + # Setup + runs-on: ubuntu-latest + + # Go + steps: + - name: Check out repo + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - name: Env + shell: bash + run: | + echo "Event name: ${{ github.event_name }}" + echo "Git ref: ${{ github.ref }}" + echo "GH actor: ${{ github.actor }}" + echo "SHA: ${{ github.sha }}" + VER=`node --version`; echo "Node ver: $VER" + VER=`npm --version`; echo "npm ver: $VER" + + - name: Install dependencies + run: npm install + + - name: Hydrate + run: npx arc hydrate + + - name: Test + run: npm test + + # Assuming all that went fine (and it's main): deploy! + deploy: + # Setup + needs: build + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + + # Go + steps: + - name: Check out repo + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - name: Install dependencies + run: npm install + + - name: Staging deploy + if: github.ref == 'refs/heads/main' + run: npx arc deploy --staging + env: + CI: true + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + + - name: Production deploy + if: startsWith(github.ref, 'refs/tags/v') + run: npx arc deploy --production + env: + CI: true + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + + - name: Staging metrics + if: github.ref == 'refs/heads/main' + run: npm run bench + env: + CI: true + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + + - name: Notify + uses: sarisia/actions-status-discord@v1 + if: always() + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + title: "deploy build" + color: 0x222222 + username: GitHub Actions