Coder Social home page Coder Social logo

meilcli / setup-crystal-action Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 2.0 9.39 MB

setup Crystal action for GitHub Actions.

Home Page: https://github.com/MeilCli/actions

License: MIT License

TypeScript 100.00%
actions github-actions crystal shards

setup-crystal-action's Introduction

setup-crystal-action

CI-Master
setup Crystal action for GitHub Actions.

Required

setup-crystal-action must execute on Linux or macOS, because I do not know usage that WSL on GitHub Actions.

Example

name: CI

on: 
  push:
    branches:    
    - master
  pull_request:
    branches:
    - master

jobs:
  example:
    runs-on: ubuntu-20.04
    steps:
      - uses: MeilCli/setup-crystal-action@v4
        with: 
          crystal_version: latest
          shards_version: latest
      - name: Run Crystal
        run: |
          echo 'puts "Hello Crystal"' > hello.cr
          crystal run hello.cr

You can also pin to a specific release version in the format @v4.x.x

input

  • crystal_version
    • required
    • install crystal version
    • value: latest or version value, see crystal-lang/crystal
    • default: latest
    • warning:
      • latest sometimes cannot find crystal binary when immediately after release
  • shards_version
    • required
    • install shards version
    • value: latest or skip or version value, see crystal-lang/shards
      • if set skip, not install shards
    • default: latest
  • github_token
    • github token, using get GitHub Release of crystal-lang/crystal or crystal-lang/shards
    • default: ${{ github.token }}
  • cache_mode
  • cache_prefix
    • if selected cache on cache_mode, option that prefix of cache key
    • Recommended use when parallel jobs
  • install_root
    • if selected none or cache on cache_mode, use directory that dicide at this option
    • default: ${{ runner.temp }}

output

  • installed_crystal_json
    • installed json that GitHub Release Asset
  • installed_shards_json
    • installed json that GitHub Release

Contributes

Could you want to contribute?

see Contributing.md

License

setup-crystal-action's People

Contributors

dependabot[bot] avatar drusellers avatar github-actions[bot] avatar meilcli avatar meilcli-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

setup-crystal-action's Issues

I don't think "tool-cache" cacheDir is doing anything

Hi. I found your usage of "@actions/tool-cache" and it was very interesting to me, as it seems to promise caching of an action's downloads across different workflow runs. However, I noticed that it never gets any cache hits. For example, if you check an example run with "show timestamps", you will see that there is always a big delay before extracting the archive, so I think it's just downloading it every time. Did you ever see it being useful? After a long search I found that this is usable only for self-hosted runners, and also that a proper caching feature for JavaScript is missing.

Failed to build with Crystal 1.2.0

Hi!

Example https://github.com/mamantoha/zipstream/runs/3920159681?check_suite_focus=true

Run MeilCli/setup-crystal-action@v4
  with:
    crystal_version: latest
    shards_version: latest
    github_token: ***
    install_root: /Users/runner/work/_temp
Error: Cannot read property 'name' of undefined

It's because for Crystal 1.2.0 macOS archive called crystal-1.2.0-1-darwin-universal.tar.gz but this action is looking for crystal-1.2.0-1-darwin-x86_64.tar.gz - https://github.com/crystal-lang/crystal/releases

Please fix. Thanks!

GITHUB_TOKEN is not necessary

I think you can use octokit directly:

const { Octokit } = require('@octokit/rest');

const octokit = new Octokit();

response = await octokit.repos.getReleaseByTag......

Instead of

import * as octkit from "@actions/github";
const github = new octkit.GitHub(option.githubToken);
let response: Response<
ReposGetReleaseByTagResponse | ReposGetLatestReleaseResponse
>;
if (option.crystalVersion != "latest") {
response = await github.repos.getReleaseByTag({

And then you don't need GITHUB_TOKEN

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.