From d8e0a1ced6b3aaef82fc8c2fd2df537f44988656 Mon Sep 17 00:00:00 2001 From: Julien Papini Date: Wed, 19 Jun 2024 17:15:38 +0200 Subject: [PATCH] chore: add pull request workflow gh action --- .github/workflows/pull-request.yml | 80 ++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..3181532 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,80 @@ +name: Pull Request + +on: + pull_request: + types: [opened, synchronize] + +jobs: + lint-commits: + name: Lint / Commits + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Linting commits + run: pnpm commitlint --from=main + + lint-files: + name: Lint / Files + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Linting files + run: pnpm run lint + + test-units: + name: Test / Units + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Building + run: pnpm run build + + - name: Testing + run: pnpm run test