Skip to content

Commit

Permalink
Merge pull request #1 from architect/ci
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
ryanblock committed Mar 28, 2023
2 parents 87717ee + c71e917 commit e0bfdab
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -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.
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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!
98 changes: 98 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
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: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 14.x ] #, 16.x, 18.x ]
os: [ windows-latest, ubuntu-latest, macOS-latest ]

# Go
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Env
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
run: npm install

- name: Test
run: npm test
env:
CI: true

- name: Notify
uses: sarisia/actions-status-discord@v1
# Only fire alert once
if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '14.x' && matrix.os == 'ubuntu-latest'
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "build and test"
color: 0x222222
username: GitHub Actions

# ----- Only git tag testing + package publishing beyond this point ----- #

# # Publish to package registries
# publish:
# # Setup
# needs: build
# if: 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/*
# registry-url: https://registry.npmjs.org/

# # Publish to npm
# - name: Publish @RC to npm
# if: contains(github.ref, 'RC')
# run: npm publish --tag RC
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# - name: Publish @latest to npm
# if: contains(github.ref, 'RC') == false #'!contains()'' doesn't work lol
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# - name: Notify
# uses: sarisia/actions-status-discord@v1
# if: always()
# with:
# webhook: ${{ secrets.DISCORD_WEBHOOK }}
# title: "npm publish"
# color: 0x222222
# username: GitHub Actions
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@architect/sandbox": "^5.6.0-RC.0",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"tap-arc": "^0.3.5",
"tape": "^5.6.3",
"tiny-json-http": "^7.5.0"
},
Expand Down
7 changes: 4 additions & 3 deletions src/_compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function compileHandler (params) {
let { arc } = inventory.inv._project
let { build, src } = lambda
stage = stage || 'testing'
let arch = lambda.config.architecture === 'arm64' ? '--arm64' : ''
let arch = lambda.config.architecture === 'arm64' ? ' --arm64' : ''

let command = `cargo build --target-dir ${build}`
if (stage !== 'testing') {
Expand All @@ -56,11 +56,12 @@ async function compileHandler (params) {
let args = minimist(process.argv.slice(2), { alias })
let isVerbose = args.verbose || args.debug

// Run the build
await rm(build, { recursive: true, force: true })

let cmdArgs = command.split(' ')
let cmdArgs = command.split(' ').filter(Boolean)
let cmd = cmdArgs.shift()

// Run the build
await new Promise((res, rej) => {
let child = spawn(cmd, cmdArgs, {
cwd: src,
Expand Down

0 comments on commit e0bfdab

Please sign in to comment.