Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will install Deno and run tests across stable and nightly builds on Windows, Ubuntu and macOS.
# For more information see: https://github.com/denolib/setup-deno

name: grammY validator

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
backport:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v7
Comment thread
KnightNiwrem marked this conversation as resolved.
with:
persist-credentials: false

- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: 24

- name: Install dependencies
run: npm install --ignore-scripts

- name: Run backporting
run: npm run backport

format-and-lint:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v7
with:
persist-credentials: false

- uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Check Format
run: deno fmt --check

- name: Lint
run: deno lint

- name: Type Check
run: deno check

test:
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS

strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
- name: Setup repo
uses: actions/checkout@v7
with:
persist-credentials: false

- uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Cache Dependencies
run: deno install

- name: Run Tests
run: deno test

coverage:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false

- uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Create coverage files
run: deno task coverage

- name: Collect coverage
uses: codecov/codecov-action@v7 # upload the report on Codecov
Comment thread
KnightNiwrem marked this conversation as resolved.
with:
files: ./test/cov_profile/lcov.info
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ package-lock.json
# Output of 'npm pack'
*.tgz

# Test coverage
test/coverage
test/cov_profile
coverage.lcov

# Build output
out/
12 changes: 11 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"lock": false,
"tasks": {
"ok": "deno fmt --check && deno lint && deno check && deno test",
"clean": "git clean -fX out test/cov_profile test/coverage coverage.lcov",
"coverage": "deno task clean && deno test --coverage=./test/cov_profile && echo 'Point your browser to test/cov_profile/html/index.html to see the test coverage report.'"
},
"fmt": {
"indentWidth": 4,
"proseWrap": "preserve"
},
"exclude": ["./node_modules/", "./out/", "./package-lock.json"],
"exclude": [
"./node_modules/",
"./out/",
"./package-lock.json",
"./test/cov_profile"
],
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.19"
}
Expand Down