diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d3cb0dea --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Memory Models Tests +on: + pull_request: + push: + branches: + - main + +jobs: + jest: + if: github.event.pull_request.draft == false + runs-on: ubuntu-22.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up node and cache packages + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Install npm packages + run: npm ci + - name: Build + run: npm run build-dev + - name: Run jest tests + run: npm run test-cov + - name: Coveralls (jest) + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index c61a2c7d..2dcca24d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Library for creating Python memory model diagrams that look hand-drawn.", "main": "dist/memory_models_rough.js", "scripts": { - "test": "jest", + "test": "jest --no-cache", + "test-cov": "jest --no-cache --collect-coverage", "watch": "webpack --watch", "build-dev": "tsc && webpack", "build": "tsc && webpack --mode production",