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