Skip to content

Commit

Permalink
Merge pull request #116 from sugarlabs/develop
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
meganindya authored Jan 26, 2022
2 parents b83e620 + c4e49fc commit 0efb959
Show file tree
Hide file tree
Showing 57 changed files with 13,563 additions and 9,899 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't ignore contents of .prototype directory
!src/.prototype
44 changes: 36 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,55 @@
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-mixed-spaces-and-tabs": "warn",
"no-unused-vars": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"quotes": ["warn", "single", { "avoidEscape": true }],
"@typescript-eslint/no-use-before-define": ["error", "nofunc"],
"quotes": [
"warn",
"single",
{
"avoidEscape": true
}
],
"semi": ["error", "always"],
"prefer-const": ["warn"],
// "no-console": "warn",
"no-console": "warn",
"max-len": [
"warn",
{
"code": 100,
"ignoreTrailingComments": true,
"ignoreComments": true,
"ignoreTrailingComments": false,
"ignoreComments": false,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
],
"no-trailing-spaces": ["warn", { "skipBlankLines": true, "ignoreComments": true }],
"no-trailing-spaces": [
"warn",
{
"skipBlankLines": true,
"ignoreComments": true
}
],
"no-duplicate-case": "error",
"no-irregular-whitespace": "warn"
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"]
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:json/recommended-with-comments"
]
}
30 changes: 0 additions & 30 deletions .github/linters/.eslintrc.json

This file was deleted.

152 changes: 152 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
# Documentation:https://help.github.com/en/articles/workflow-syntax-for-github-actions

name: Continuous Deployment

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: Lint Code Base

strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout the code base
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
yarn install --frozen-lockfile
- name: Lint new and edited files
uses: github/super-linter/slim@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: develop
LINTER_RULES_PATH: /
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.json
MARKDOWN_CONFIG_FILE: .markdownlint.jsonc
VALIDATE_ALL_CODEBASE: false
VALIDATE_DOCKERFILE: false
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_TYPESCRIPT_STANDARD: false
VALIDATE_JSCPD: false
VALIDATE_PYTHON: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_PYTHON_PYLINT: false

smoke-test:
name: Smoke Test

strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout the code base
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build the project
run: yarn run build

regression-test:
name: Regression Test

strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout the code base
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run unit tests
run: yarn run test

deploy:
name: Deploy package to GitHub npm registry

if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true)
needs: [lint, smoke-test, regression-test]

strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout the code base
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Deploy to registry
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
npm run build
cp package.json dist/package.json
cp README.md dist/README.md
cd dist
npm pack
cp ./*.tgz ../
cd ..
npm publish "$(set -- *.tgz; echo "$1")"
rm -rf dist ./*.tgz .npmrc
87 changes: 46 additions & 41 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,65 @@
---
#######################
#######################
## CI GitHub Actions ##
#######################
#######################
name: Continuous Integration
# Documentation:https://help.github.com/en/articles/workflow-syntax-for-github-actions

#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#
name: Continuous Integration

#############################
# Start the job on all push #
#############################
on:
push:
branches: [develop, main]
branches: [develop]
pull_request:
branches: [develop, main]
branches: [develop]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Continuous Integration
# Set the agent to run on
runs-on: ubuntu-latest
smoke-test:
name: Smoke Test

strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout the code base
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build the project
run: yarn run build

regression-test:
name: Regression Test

strategy:
matrix:
node-version: [12.x, 14.x]
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- uses: actions/checkout@v2
- name: Checkout the code base
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

###################
# Run npm scripts #
###################
- name: Install dependencies
run: yarn install --frozen-lockfile

- run: npm ci
# - run: npm run build --if-present
- run: npm test --if-present
env:
DEFAULT_BRANCH: develop
- name: Run unit tests
run: yarn run test
Loading

0 comments on commit 0efb959

Please sign in to comment.