From 40f1fea8b9ed2abf9690444c7df11dab2417d1ed Mon Sep 17 00:00:00 2001 From: h-takeyeah <61489178+h-takeyeah@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:42:32 +0900 Subject: [PATCH] ci[typing-app]: new workflow --- .github/workflows/nodejsci.yml | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/nodejsci.yml diff --git a/.github/workflows/nodejsci.yml b/.github/workflows/nodejsci.yml new file mode 100644 index 0000000..7a95639 --- /dev/null +++ b/.github/workflows/nodejsci.yml @@ -0,0 +1,57 @@ +name: CI (typing-app) + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + paths: + - "typing-app/**" + +defaults: + run: + working-directory: ./typing-app + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + id: cache + with: + path: | + ${{ github.workspace }}/typing-app/node_modules + ${{ github.workspace }}/typing-app/.next/cache + key: ${{ runner.os }}-bun-cache-${{ hashFiles('typing-app/bun.lockb') }} + restore-keys: ${{ runner.os }}-bun-cache- + - uses: oven-sh/setup-bun@v1 + if: steps.cache.outputs.cache-hit != 'true' + with: + bun-version: latest + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: bun install + - name: Try to build + run: npm run build + + lint: + name: Lint + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: | + ${{ github.workspace }}/typing-app/node_modules + ${{ github.workspace }}/typing-app/.next/cache + key: ${{ runner.os }}-bun-cache-${{ hashFiles('typing-app/bun.lockb') }} + fail-on-cache-miss: true + - name: Run lint + run: npm run lint