Skip to content

Commit

Permalink
gh: add the PR workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pajicf committed Dec 10, 2023
1 parent a31be11 commit 8b3ab2d
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: PR Tests

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
dependencies:
runs-on: ubuntu-latest

container:
image: node:18

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

lint:
runs-on: ubuntu-latest
needs: dependencies

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Load node modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}

- name: Code passes lint check
run: yarn lint

test:
runs-on: ubuntu-latest
needs: dependencies

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Load node modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}

- name: All Tests pass
run: yarn test

0 comments on commit 8b3ab2d

Please sign in to comment.