From 77071777bf7000fb8e88aaa32f255794a386e12b Mon Sep 17 00:00:00 2001 From: Gabriel Logan Date: Fri, 4 Oct 2024 01:54:04 -0300 Subject: [PATCH] chore: Add PR Check workflow --- .github/workflows/pr-check.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pr-check.yml diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 0000000..6604115 --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,35 @@ +name: PR Check + +on: + # Runs on pushes targeting the default branch + pull_request: + branches: ['main'] + push: + branches: ['main'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'yarn' + - run: yarn install + - run: yarn build + - name: Check if dist and types directories exist + run: | + if [ ! -d "dist" ]; then + echo "Error: dist directory does not exist." + exit 1 + fi + if [ ! -d "types" ]; then + echo "Error: types directory does not exist." + exit 1 + fi + - name: Run tests + run: yarn test