Skip to content

Commit

Permalink
ci: add autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Jul 4, 2024
1 parent 009699f commit 6a2d498
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 21 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: autofix.ci

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
autofix:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node LTS ✨
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install Dependencies 📦️
run: pnpm i

- name: Lint
run: pnpm lint:fix

- uses: autofix-ci/action@v1
51 changes: 30 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,57 @@ on:
- main

jobs:
lint:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set node
uses: actions/setup-node@v3
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node LTS ✨
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: lts/*
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni
- name: Install Dependencies 📦️
run: pnpm i

- name: Install
run: nci
- name: Build
run: pnpm build

- name: Lint
run: nr lint
- name: Typecheck
run: pnpm typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [20.x, 18.x]
node: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci
- name: Install Dependencies 📦️
run: pnpm i

- name: Build
run: nr build
run: pnpm build

- name: Test
run: nr test
run: pnpm test

0 comments on commit 6a2d498

Please sign in to comment.