Giter Site home page Giter Site logo

setup-deno's Introduction

setup-deno

Test the action

Deno Setup action with integrated cache.

Usage

Basic:

- uses: nekowinston/setup-deno@v1

All options:

- uses: nekowinston/setup-deno@v1
  with:
    deno-version: "~1.38"
    deno-json-path: ./subdirectory/deno.json
    deno-lock-path: ./subdirectory/deno.lock
    directory: ./subdirectory

Inputs

  • deno-version:
    The Deno version to install. Can be a semver version of a stable release, 'canary' for the latest canary, or the Git hash of a specific canary release.
    See setup-deno for examples.
    Defaults to 1.x.
  • deno-json-path:
    The path to the Deno config file to use for caching.
    Defaults to an empty string, using the built-in CLI default.
  • deno-lock-path:
    The path to the lock file to use for caching.
    Defaults to ./deno.lock.
  • directory:
    The path to the scripts to cache. This can be useful if Deno is only part of your repo, and stored in a subdirectory.
    Defaults to the repo root.

Outputs:

  • deno-version: The Deno version that was installed.
  • is-canary: If the installed Deno version was a canary version.
  • cache-hit: A boolean value to indicate an exact match was found for the key.

setup-deno's People

Contributors

dependabot[bot] avatar nekowinston avatar uncenter avatar

Stargazers

 avatar  avatar

Watchers

 avatar

setup-deno's Issues

Use JS glob + ignore for the cache glob step

The current find ${{ inputs.directory }} -regex '.*\.[jt]sx*' -exec deno cache {} \; stuff is pretty... gross.
I'd like to make picking the files which deno caches more customizable and intuitive.

Ideally, this would be handled by the deno binary itself; e.g.:

Repo layout:

/
โ”œโ”€โ”€ test/
โ”‚   โ”œโ”€โ”€ basic/
โ”‚   โ”‚   โ””โ”€โ”€ main.ts*
โ”‚   โ”œโ”€โ”€ customized/
โ”‚   โ”‚   โ”œโ”€โ”€ deno.json
โ”‚   โ”‚   โ”œโ”€โ”€ deno.lock
โ”‚   โ”‚   โ””โ”€โ”€ main.ts
โ”‚   โ””โ”€โ”€ problem-matcher/
โ”‚       โ”œโ”€โ”€ deno.json
โ”‚       โ”œโ”€โ”€ deno.lock
โ”‚       โ”œโ”€โ”€ foo.ts
โ”‚       โ”œโ”€โ”€ foo_test.ts
โ”‚       โ””โ”€โ”€ main.ts
โ”œโ”€โ”€ .denoignore
โ””โ”€โ”€ deno.json

.denoignore:

test/problem-matcher
!test/problem-matcher/foo.ts
$ deno cache
-> caching test/basic/main.ts
-> caching test/customized/main.ts
-> caching test/problem-matcher/foo.ts

Working around the fact that this isn't supported by the binary, we could create a script that works in both Node (for actions) and Deno (for the dev), which effectively does this. The dev could add this script to the deno.json like

{
  "tasks": {
    "cache": "deno run -A https://esm.sh/gh/nekowinston/setup-deno/cache.ts"
  }
}

Which then calls deno cache on each file in the glob pattern, storing it in deno.lock.
The Node script would have the same files in its match, with improved customizability compared to just a single action input for a directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.