From b7542c70cb9f0e2b69b623e48cbe7f98b7b923e4 Mon Sep 17 00:00:00 2001 From: Redon <790348264@qq.com> Date: Mon, 13 Feb 2023 18:58:26 +0800 Subject: [PATCH] Create ci.yml chore: test cli --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bacbba3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Lint + run: nr lint:fix + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Typecheck + run: nr typecheck + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node: [18.x] + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - name: Set node ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Build + run: nr build + + - name: Test + run: nr preview