Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
πŸ“ add test coverage instructions and in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelStark committed Sep 24, 2024
1 parent ed07f05 commit 4b74585
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,18 @@ jobs:
- name: Run tests
run: mix test
env:
MIX_ENV: dev
MIX_ENV: test

- name: Run test coverage
run: mix coveralls.json
env:
MIX_ENV: test

- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: cover/excoveralls.json

- name: Check formatting
run: mix format --check-formatted
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ mix phx.server
- Migrate: `mix ecto.migrate`
- Reset: `mix ecto.reset`

### πŸ§ͺ Testing Magic

- **Run All Tests**: `mix test`
- **Mock the Database**:
To use a mock database for testing, set the `MOCK_REPO` environment variable:

```bash
MOCK_REPO=true mix test
```

- **Test Coverage**:
Unveil the secrets of your test coverage:

```bash
MIX_ENV=test mix coveralls
```

For a detailed HTML report, cast this spell:

```bash
MIX_ENV=test mix coveralls.html
```

The mystical report will appear in `cover/excoveralls.html`.

### πŸ” Code Quality and Security

Ensure your code is top-notch with these magical incantations:
Expand Down

0 comments on commit 4b74585

Please sign in to comment.