Skip to content

Updates the CI process #206

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

Merged
merged 6 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/build.yml

This file was deleted.

256 changes: 256 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
name: ci

on:
push:
branches:
- main
- beta
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true

env:
NODE_VERSION: 14

jobs:
install-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Cache dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
npm install
static-analysis:
runs-on: ubuntu-latest
needs: install-cache
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run prettier
run: |
npm run format:check
- name: Run lint
run: |
npm run lint
- name: Danger
if: github.event_name == 'pull_request'
run: npm run danger:pr -- ci
env:
PR: ${{ github.event.number }}
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit-test-scan:
runs-on: ubuntu-latest
needs: install-cache
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run tests
run: |
npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}
build:
runs-on: ubuntu-latest
needs: [static-analysis, unit-test-scan]
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run lint
run: |
npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build-output
path: dist
retention-days: 1
build-example:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-output
path: dist
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Check example
run: |
npm install
npm run build
working-directory: ./example
build-storybook:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Build Storybook
run: npm run build-storybook --quiet
release:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-output
path: dist
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
publish-storybook:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout Commit
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Publish Storybook
if: github.ref == 'refs/heads/main'
run: npm run deploy-storybook -- --ci
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
54 changes: 0 additions & 54 deletions .github/workflows/release.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/size.yml

This file was deleted.

1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit ""
npx --no-install commitlint --edit ""
7 changes: 7 additions & 0 deletions example/.proxyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function (app) {
app.use((req, res, next) => {
res.removeHeader('Cross-Origin-Resource-Policy')
res.removeHeader('Cross-Origin-Embedder-Policy')
next()
})
}
Loading