From 882be32821bc9b3576955b18d6bda6aef6e9e1e9 Mon Sep 17 00:00:00 2001 From: Zeyu Zhang <39144422+zeyu2001@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:59:56 +0800 Subject: [PATCH] ci: linting, tests --- .github/workflows/linting.yml | 32 ++++++++++++++++++++ .github/workflows/tests.yml | 55 +++++++++++++++++++++++++++++++++++ .nvmrc | 1 + 3 files changed, 88 insertions(+) create mode 100644 .github/workflows/linting.yml create mode 100644 .github/workflows/tests.yml create mode 100644 .nvmrc diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..6da8579 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,32 @@ +name: Linting + +on: + push: + branches-ignore: + - develop + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Setup Node LTS ✨ + uses: actions/setup-node@v3 + with: + cache: pnpm + node-version: lts/* + + - name: Installing dependencies 📦️ + run: pnpm install + + - name: Lint 🛀 + run: pnpm -r run lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..777eeff --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,55 @@ +name: Tests + +on: + pull_request: + branches: [develop] + push: + branches: [develop] + +jobs: + tests: + runs-on: ubuntu-latest + name: Run tests + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - uses: actions/setup-node@v3 + with: + cache: pnpm + node-version-file: ".nvmrc" + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: | + pnpm -r run test + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - uses: actions/setup-node@v3 + with: + cache: pnpm + node-version-file: ".nvmrc" + + - name: Install + run: pnpm install + + - name: Compile + run: | + pnpm -r run build diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..016efd8 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.10.0 \ No newline at end of file