From 49783ac947252b46fa78817e098048cf5d84fe6f Mon Sep 17 00:00:00 2001 From: Olaf Cichocki Date: Fri, 13 Dec 2024 11:12:35 +0100 Subject: [PATCH] ci(config): Add verification --- .github/pr-validate.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/pr-validate.yml diff --git a/.github/pr-validate.yml b/.github/pr-validate.yml new file mode 100644 index 00000000..03411574 --- /dev/null +++ b/.github/pr-validate.yml @@ -0,0 +1,38 @@ +name: Pull Request + +on: [pull_request_target] #To ensure better security and avoid running on forks + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + version: [14, 16, 18] + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.version }} + cache: 'npm' + + - name: Cache Node.js modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ matrix.version }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.version }}- + + - name: Installing dependencies + run: npm ci + + - name: Running tests + run: npm run test + + - name: Running lint + run: npm run lint + + - name: Running typecheck + run: npm run typecheck