From 0f487e3af235842c2869b525f316d2ea455aa984 Mon Sep 17 00:00:00 2001 From: Ebod Shojaei Date: Wed, 29 Jan 2025 18:57:58 -0800 Subject: [PATCH] =?UTF-8?q?(add)=20GitHub=20Continuous=20Integration=20(CI?= =?UTF-8?q?)=20workflows=20=E2=9A=99=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/node.js.yml | 56 +++++++++++++++++++++++++++++++++++ .github/workflows/stale.yml | 29 ++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/workflows/node.js.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..7dda92e --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,56 @@ +# This file builds and runs the Node server for the client using pnpm. +# Checks to ensure successful compile, lint, and run. +# +# The versioning is locked in the client folder. See @pnpm-lock.yaml file. +# + +name: Node.js CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + lint-and-build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install System Dependencies + run: | + if [ "$RUNNER_OS" = "Linux" ]; then + sudo apt-get update && sudo apt-get install -y python3 build-essential curl + fi + + - name: Install pnpm + run: | + npm install -g pnpm + pnpm --version + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + working-directory: client + + - name: List Installed Node Modules + run: ls -la client/node_modules + + - name: Run Lint + run: pnpm lint + working-directory: client + + - name: Run Build + run: pnpm build + working-directory: client diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..1916265 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,29 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# Custom time set to 4:00 PM UTC (8:00 AM PST) +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '0 16 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity'