Skip to content

Commit

Permalink
setup CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Apr 21, 2023
1 parent 435745e commit c5067cc
Show file tree
Hide file tree
Showing 11 changed files with 1,133 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a bug report to report a bug and help us to improve massa-as-sdk
title: ''
labels: 'issue:bug'
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version**
The versions of software and packages the bug is present in (massa-as-sdk, thyra, web browser...).

**Additional context**
Add any other context about the problem here.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Task
about: Create a new task for the Innovation team to work on
title: ''
assignees: ''
---

**Context**
_Describe / explain why we should do this: motivations, context or other info. Keep it brief and simple - PM_

**User flow**
_Describe the user flow using user stories so the end result is super clear - PM_

**How to**
_List the step-by-step to get it do if needed - PM_

**Technical details**
_Give the technical insights so anyone in the team can tackle the tasks - Dev_

**QA testing**
_Does this task require some QA tests?_
_If yes, explain how to validate it_
22 changes: 22 additions & 0 deletions .github/workflows/npm-publish-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Npm nightly publish

on:
push:
branches: [main]

jobs:
test:
uses: ./.github/workflows/tests.yml

publish-npm-dev:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- run: ./scripts/publish-dev.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
26 changes: 26 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- v*

jobs:
test:
uses: ./.github/workflows/tests.yml

publish-npm:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- run: |
npm pkg delete scripts.prepare
npm ci
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
23 changes: 23 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
push:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run test
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.{js,jsx,ts,tsx}": "eslint --fix --cache",
"*.css": "stylelint --fix",
"*.{js,jsx,ts,tsx,css,html,json,md,mdx}": "prettier --write"
}
Loading

0 comments on commit c5067cc

Please sign in to comment.