From 97cbe57f154522fe6dc6b1ff82e32c072c9bb754 Mon Sep 17 00:00:00 2001 From: isqua Date: Sun, 2 Jun 2024 14:29:32 +0700 Subject: [PATCH] chore: set up checks with Github Actions --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1cf2d27 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Main + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: package-lock.json + - name: install dependencies + run: npm ci + - name: lint + run: npm run lint + + audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: package-lock.json + - name: run audit + run: npm audit --production diff --git a/package.json b/package.json index 7950ce3..5e8ab46 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "vite", "build": "tsc && vite build --base=\"${PUBLIC_URL:-/}\"", "preview": "vite preview", + "lint": "npm run style", "style": "prettier --check src index.html", "reformat": "prettier --write src index.html" },