Skip to content

Commit

Permalink
Run tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Apr 16, 2024
1 parent b48a4e2 commit 85473e6
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: main
on: [push, pull_request]

jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
permissions:
contents: read
issues: read
checks: write
pull-requests: write
runs-on: ${{ matrix.os }}
steps:
- run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno task test --coverage=.cov --junit-path=.test-report.xml
- uses: EnricoMi/publish-unit-test-result-action@v2
if: runner.os == 'Linux' && always()
with:
check_name: "Test Results (Linux)"
files: .test-report.xml
- uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: runner.os == 'macOS' && always()
with:
check_name: "Test Results (macOS)"
files: .test-report.xml
- uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: runner.os == 'Windows' && always()
with:
check_name: "Test Results (Windows)"
files: .test-report.xml
- run: deno coverage --lcov .cov > .cov.lcov
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: dahlia/logtape
file: .cov.lcov
- run: deno task check
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
}
},
"cSpell.words": [
"Codecov",
"consolemock",
"deno",
"hongminhee",
"logtape",
"supercategory"
"supercategory",
"venv"
]
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
LogTape
=======

[![GitHub Actions][GitHub Actions badge]][GitHub Actions]
[![Codecov][Codecov badge]][Codecov]

LogTape is a simple logging library for Deno/Node.js/Bun/browsers. It is
designed to be used for both applications and libraries.

Currently, LogTape provides only few sinks, but you can easily add your own
sinks.

[GitHub Actions]: https://github.com/dahlia/logtape/actions/workflows/main.yaml
[GitHub Actions badge]: https://github.com/dahlia/logtape/actions/workflows/main.yaml/badge.svg
[Codecov]: https://codecov.io/gh/dahlia/logtape
[Codecov badge]: https://codecov.io/gh/dahlia/logtape/graph/badge.svg?token=yOejfcuX7r
7 changes: 6 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
"@std/testing": "jsr:@std/testing@^0.222.1",
"consolemock": "npm:consolemock@^1.1.0"
},
"exclude": [
"*-venv/",
"coverage/",
"README.md"
],
"lock": false,
"tasks": {
"check": "deno check **/*.ts && deno lint",
"check": "deno check **/*.ts && deno lint && deno fmt --check",
"test": "deno test --allow-read=logtape/__snapshots__ --allow-write=logtape/__snapshots__",
"coverage": "rm -rf coverage && deno task test --coverage && deno coverage --html coverage",
"hooks:install": "deno run --allow-read=deno.json,.git/hooks/ --allow-write=.git/hooks/ jsr:@hongminhee/deno-task-hooks",
Expand Down

0 comments on commit 85473e6

Please sign in to comment.