CI #1438
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# ESLint is a tool for identifying and reporting on patterns | |
# found in ECMAScript/JavaScript code. | |
# More details at https://github.com/eslint/eslint | |
# and https://eslint.org | |
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '15 10 * * 5' | |
workflow_call: | |
jobs: | |
eslint: | |
name: Run eslint scanning | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.3.1 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install depends | |
run: sh install.sh | |
- name: Run ESLint | |
run: pnpm lint #--fix | |
# - name: Commit changes | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# author_name: GitHub Actions | |
# author_email: actions@github.com | |
# message: 'chore: `eslint --fix`' | |
# push: origin main | |
prettier: | |
name: Run Prettier | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.3.1 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install depends | |
run: sh install.sh | |
- name: Fretit | |
run: pnpm pretit | |
# - name: Commit changes | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# author_name: GitHub Actions | |
# author_email: actions@github.com | |
# message: 'chore: `prettier -w`' | |
# push: origin main | |
typing: | |
name: Run Type Checking | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.3.1 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install depends | |
run: sh install.sh | |
- uses: Wandalen/wretry.action@master | |
name: Test | |
continue-on-error: true | |
with: | |
command: pnpm test | |
attempt_limit: 3 | |
attempt_delay: 2000 | |
- name: Typing | |
run: pnpm typing | |
test: | |
name: Run Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node_version: [16, 20] | |
include: | |
# Active LTS + other OS | |
- os: macos-latest | |
node_version: 18 | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2.3.1 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.3.1 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install depends | |
run: sh install.sh | |
- name: Fix test | |
run: pnpm fixtest | |
- uses: Wandalen/wretry.action@master | |
name: Test | |
with: | |
command: pnpm test | |
attempt_limit: 3 | |
attempt_delay: 2000 | |
# build: | |
# name: Try build | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: [ubuntu-latest] | |
# node_version: [16, 18, 20] | |
# include: | |
# # Active LTS + other OS | |
# - os: macos-latest | |
# node_version: 18 | |
# - os: windows-latest | |
# node_version: 18 | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v3 | |
# - name: Install Node.js | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 18 | |
# - uses: pnpm/action-setup@v2.0.1 | |
# name: Install pnpm | |
# id: pnpm-install | |
# with: | |
# version: 8.3.1 | |
# run_install: false | |
# - name: Install depends | |
# run: sh install.sh | |
# - name: Build | |
# run: cp .env.example .env && pnpm build |