Skip to content

Commit

Permalink
Deactivate code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
WebDucer committed Jul 29, 2024
1 parent 17462d6 commit 37af9f5
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/_codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CodeQL

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '31 7 * * 3'

permissions:
actions: read
checks: write
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language:
- TypeScript

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,43 @@ or run output.
with:
lcov-file: './coverage/lcov.info'
excluded-files: '**/*.g.dart, **/*.freezed.dart, **/.realm.dart'

- name: Coverage output
run: |
echo "${{ steps.lcov-result.outputs.coverage }}"
echo "${{ steps.lcov-result.outputs.markdown-table }}"
```
### Configuration parameters
#### `lcov-file`

Path to the lcov file to parse (currently only one file supported).

#### `excluded-files`

Comma separated list of files, that should be excluded from code coverade report. Common globes can be used here:

- `**`: folder globe (e.g. `**/email.dart` would match `foo/email.dart` but also `foo/bar/foo-bar/email.dart`)
- `*`: file name globe (e.g. `**/email-*-validation.dart` would match `email-domain-validation.dart` but not `emailvalidation.dart`)

### Overall coverage result

22.83

### Mardown Table result

| File | Line Coverage | Function Coverage | Branch Coverage |
| --- | --- | --- | --- |
| lib/domain/models/email.dart | 100.00% | 0.00% | 0.00% |
| lib/core/exceptions/exceptions.dart | 40.00% | 0.00% | 0.00% |

## TODO

- [x] Parse lcov file, so it is easier to handle the results
- [x] Provide following outputs
- Markdown table with code coverage per test file
- Overall coverage
- [ ] Add possibility to "comment" on PR
- [ ] Add possibility for run output
- [ ] Add templates

0 comments on commit 37af9f5

Please sign in to comment.