diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54ec224..ed6f075 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,11 +1,6 @@ name: CI -on: - pull_request: - branches: - - main - schedule: - - cron: '0 13 * * 6' # At 13:00 on Saturday +on: [push] permissions: {} @@ -97,7 +92,9 @@ jobs: disable-sudo: true egress-policy: block allowed-endpoints: > + coveralls.io:443 dl.google.com:443 + objects.githubusercontent.com:443 github.com:443 registry.npmjs.org:443 @@ -116,12 +113,13 @@ jobs: run: npm ci - name: Run tests - run: | - npm exec \ - --no \ - --package=jest \ - -- \ - jest + run: npm test + + - name: Publish Coverage Report + uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: coverage/lcov.info android-build: name: Android Build diff --git a/.gitignore b/.gitignore index a6ed353..f662df0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +coverage/ node_modules/ .lsp/ *~ @@ -15,8 +16,6 @@ npm-debug.* web-build/ android/ ios/ -assets/* -!assets/**/*.svg # macOS .DS_Store diff --git a/README.md b/README.md index f5f6563..7646a99 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # SBE Mental Health App [![CI](https://github.com/safsbe/mental-health-app/actions/workflows/ci.yaml/badge.svg)](https://github.com/safsbe/mental-health-app/actions/workflows/ci.yaml) +[![Coverage Status](https://coveralls.io/repos/github/safsbe/mental-health-app/badge.svg?branch=main)](https://coveralls.io/github/safsbe/mental-health-app?branch=main) A proof of concept application created by the SBE Innovation Team, part of the SBE NSF Council. diff --git a/jest.config.json b/jest.config.json new file mode 100644 index 0000000..c91f978 --- /dev/null +++ b/jest.config.json @@ -0,0 +1,9 @@ +{ + "preset": "jest-expo", + "collectCoverage": true, + "collectCoverageFrom": [ + "components/**", + "!components/__tests__/**", + "app/**" + ] +} diff --git a/package.json b/package.json index 26b0b4e..8af0246 100644 --- a/package.json +++ b/package.json @@ -24,15 +24,12 @@ "test:watch": "jest --watchAll", "eslint": "eslint .", "eslint:fix": "npm run eslint -- --fix", - "prettier:cli": "prettier '**/*.md' '**/*.ts' '**/*.tsx' '**/*.js' '**/*.mjs'", + "prettier:cli": "prettier '**/*.md' '**/*.ts' '**/*.tsx' '**/*.js' '**/*.mjs' '!assets/**'", "prettier:check": "npm run prettier:cli -- --check", "prettier:fix": "npm run prettier:cli -- --write", "lint:check": "npm run eslint && npm run prettier:check", "lint:fix": "npm run eslint:fix && npm run prettier:fix" }, - "jest": { - "preset": "jest-expo" - }, "dependencies": { "@expo-google-fonts/mulish": "^0.2.3", "@expo/vector-icons": "^14.0.3",