From d73bb88f1dfa4cc97ea0dac6380234530cb99475 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Thu, 22 May 2025 10:33:40 +0100 Subject: [PATCH] tests: test process on github and husky --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ .husky/pre-commit | 5 +++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..9210df4c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Tests + +on: + pull_request: + branches: [ dev ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run admin-ui tests + working-directory: packages/admin-ui + run: npm run test:run \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index d24fdfc6..82ad515e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,9 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +# Run tests first +echo "Running tests..." +npm run test:run --workspace=packages/admin-ui + +# Run linting npx lint-staged