From 0eac56f83fd48b73607e0e89dc8629f0e3ce993c Mon Sep 17 00:00:00 2001 From: "Jason M. Hasperhoven" Date: Mon, 9 Sep 2024 17:15:33 +0400 Subject: [PATCH] Add ci workflow --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ eslintinit.config.js | 13 -------- 2 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 eslintinit.config.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8dea247a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI +on: + workflow_call: + workflow_dispatch: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Lint + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - uses: actions/checkout@v4 + - id: lint + uses: buildjet/cache@v4 + with: + path: .next + key: $${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-lint + restore-keys: $${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled + - uses: pnpm/action-setup@v4 + - uses: buildjet/setup-node@v4 + with: + node-version: "18" + cache: "pnpm" + - run: pnpm install --frozen-lockfile + - run: pnpm lint:strict --cache-dir=.next + + build: + name: Build + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - uses: actions/checkout@v4 + - id: build + uses: buildjet/cache@v4 + with: + path: .next + key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-built + restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled + - uses: pnpm/action-setup@v4 + - uses: buildjet/setup-node@v4 + with: + node-version: "18" + cache: "pnpm" + - run: pnpm install --frozen-lockfile + - run: pnpm build --cache-dir=.next + + # test: + # name: test + # runs-on: buildjet-4vcpu-ubuntu-2204 + # steps: + # - uses: actions/checkout@v4 + # - id: tested + # uses: buildjet/cache@v4 + # with: + # path: .next + # key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-test + # restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled + # - uses: pnpm/action-setup@v4 + # - uses: buildjet/setup-node@v4 + # with: + # node-version: "22" + # cache: "pnpm" + # - run: pnpm install --frozen-lockfile + # - run: pnpm test --cache-dir=.next diff --git a/eslintinit.config.js b/eslintinit.config.js deleted file mode 100644 index c6920932..00000000 --- a/eslintinit.config.js +++ /dev/null @@ -1,13 +0,0 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; -import pluginReact from "eslint-plugin-react"; - - -export default [ - {files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]}, - {languageOptions: { globals: globals.browser }}, - pluginJs.configs.recommended, - ...tseslint.configs.recommended, - pluginReact.configs.flat.recommended, -]; \ No newline at end of file