Skip to content

Instantly share code, notes, and snippets.

@niklasmtj
Created March 7, 2024 13:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niklasmtj/bd0f8e2da5e548bb028804913003e98f to your computer and use it in GitHub Desktop.
Save niklasmtj/bd0f8e2da5e548bb028804913003e98f to your computer and use it in GitHub Desktop.
Github Action that can be used for running CI tasks in Deno. Run tests, check code for formatting errors and lint the code base. Fails on found irregularities in tests, format (fmt) and linting
name: "CI"
on:
- pull_request
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup Deno"
uses: denoland/setup-deno@v1
with:
deno-version: "1.x"
- name: "Run Tests"
run: deno task test
- name: "Run Lint"
run: deno task lint
- name: "Run Format"
run: deno task format
{
"tasks": {
"dev": "deno run --watch main.ts",
"lint": "deno lint",
"format": "deno fmt --check",
"test": "deno test --allow-read --allow-write --allow-net"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment