From 6107198450b4d19304531b05ff1026e19cca165c Mon Sep 17 00:00:00 2001 From: TheTallJerry <67441706+TheTallJerry@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:58:22 -0500 Subject: [PATCH] Set up GitHub Actions for jest (#16) --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml 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",