64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
name: CI script
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🏗 Setup repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🏗 Setup node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16.x
|
|
cache: 'yarn'
|
|
|
|
- name: 🏗 Install dependencies
|
|
run: yarn
|
|
|
|
- name: 📦 Lint with eslint
|
|
run: yarn lint
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_STAGING }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_STAGING }}
|
|
steps:
|
|
- name: 🏗 Setup repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🏗 Install Vercel CLI
|
|
run: npm install --global vercel@latest
|
|
|
|
- name: 🏗 Pull staging app from vercel environment
|
|
run: vercel pull --yes --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
|
|
|
- name: 📦 Build staging app artifacts
|
|
run: vercel build --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
|
|
|
test-coverage:
|
|
name: SonarCloud
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: 🏗 Install dependencies
|
|
run: yarn
|
|
|
|
- name: 📦 Test and coverage
|
|
run: yarn coverage
|
|
|
|
- name: 📦 SonarCloud Scan
|
|
uses: SonarSource/sonarcloud-github-action@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |