Quality #443
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Quality" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [ '16.14.2', '18.17.0' ] | |
name: "Setup" | |
steps: | |
- name: "⚙ Set up Node.js v${{ matrix.node }}" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: "✅ Checkout repository" | |
uses: actions/checkout@v3 | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [ '16.14.2', '18.17.0' ] | |
needs: setup | |
name: "Build" | |
steps: | |
- name: "⚙ Set up Node.js v${{ matrix.node }}" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: "✅ Checkout repository" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "💾 Restore Dependencies from cache" | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: "🦉 GitGuardian scan" | |
uses: GitGuardian/ggshield-action@master | |
env: | |
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} | |
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} | |
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} | |
- name: "📦 Install Dependencies" | |
run: yarn install | |
- name: "💅 Lint" | |
run: yarn lint | |
- name: "🔨 Build" | |
run: yarn build --force && node sonar-args.js | |
- name: "👨💻 Run Test" | |
run: | | |
yarn test --force | |
yarn report | |
env: | |
NODE_ENV: 'test' | |
- name: "📤 Upload artifact" | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./mochawesome-report | |
- name: "🚀 Deploy Report" | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
publish_dir: ./mochawesome-report | |
destination_dir: mochawesome-report | |
- name: "📊 Upload coverage report to Codecov" | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: "📊 SonarCloud Scan" | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |