Skip to content

Commit

Permalink
add tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jwkaterina committed Apr 26, 2024
1 parent 1a4d15f commit 90a1c56
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ name: Deploy to Firebase Hosting on merge
branches:
- main
jobs:
build_and_deploy:
build_test_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand All @@ -20,3 +25,5 @@ jobs:
projectId: nutrition-3236d
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
- name: Update Coverage Badge
uses: we-cli/coverage-badge-action@main
9 changes: 7 additions & 2 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ permissions:
contents: read
pull-requests: write
jobs:
build_and_preview:
build_test_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const config: Config = {
collectCoverage: true,

// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,
collectCoverageFrom: ['src/**/*.ts', 'src/**/*.tsx'],

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
Expand Down

0 comments on commit 90a1c56

Please sign in to comment.