init #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Deno Test | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.ts' | |
- '.github/workflows/test.yml' | |
- 'deno.jsonc' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.ts' | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Check | |
run: deno task check | |
- name: Run linter | |
run: deno task lint | |
- name: Run test with coverage report | |
shell: bash | |
run: | | |
deno task test:coverage | |
deno task coverage:lco | |
deno task coverage:show >> .coverage/result.txt | |
- name: Upload coverage report to Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: my-artifact | |
path: ./.coverage | |
- name: Create commit comment | |
uses: peter-evans/commit-comment@v3 | |
with: | |
body: | | |
Deno test coverage report | |
$(cat .coverage/result.txt) | |
coverage: | |
needs: test | |
runs-on: ubuntu-latest | |
permissions: | |
write-all | |
steps: | |
- name: Download coverage report from Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: my-artifact | |
path: ./.coverage | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4.3.0 | |
with: | |
file: ./.coverage/lcov.info | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: ${{ github.repository }} | |
- name: Create commit comment | |
uses: peter-evans/commit-comment@v3 | |
with: | |
body: | | |
Deno test coverage report | |
$(cat .coverage/result.txt) | |
jsr-publish-dry-run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: ${{ env.DENO_VERSION }} | |
- run: deno publish --dry-run | |
action-timeline: | |
needs: | |
- test | |
- coverage | |
- jsr-publish-dry-run | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: Kesin11/actions-timeline@v2 |