Skip to content

merge master

merge master #20

Workflow file for this run

name: Lint and Test
on:
pull_request:
branches: ["**"]
push:
branches:
- "**"
jobs:
# https://github.com/snezhig/obsidian-front-matter-title/blob/master/.github/workflows/main.yml
validate:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Install Dependencies
run: npm install -g pnpm && pnpm install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"
- run: pnpm i
# - name: Eslint
# run: pnpm run lint
- name: Run test
run: pnpm run test
pretty:
needs: validate
runs-on: ubuntu-latest
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Newdea/obsidian-spaced-repetition-recall'
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Prettify code
uses: creyD/prettier_action@v4.3
with:
prettier_version: ^3.1.1
# This part is also where you can pass other options, for example:
# prettier_options: --write *.ts *.json src test --ignore-path package-lock.json
# --config .prettierrc.json --ignore-path package-lock.json pnpm-lock.yaml
prettier_options: --write .
lint_and_test:
needs: pretty
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm install -g pnpm && pnpm install
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test