Giter Club home page Giter Club logo

setup-clojure's Introduction

setup-clojure

This action sets up Clojure tools environment for using in GitHub Actions.

All three major tools (Clojure CLI, leiningen and boot-clj) available for MacOS, Ubuntu and Windows based runners. Please look at Smoke Test Workflow file for compatibility matrix.

Usage

Here is a snippet for your workflow file:

name: Example workflow

on: [push]

jobs:

  clojure:

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

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      # It is important to install java before installing clojure tools which needs java
      # exclusions: babashka, clj-kondo and cljstyle
      - name: Prepare java
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: '8'

      - name: Install clojure tools
        uses: DeLaGuardo/[email protected]
        with:
          # Install just one or all simultaneously
          # The value must indicate a particular version of the tool, or use 'latest'
          # to always provision the latest version
          cli: 1.10.1.693              # Clojure CLI based on tools.deps
          lein: 2.9.1                  # Leiningen
          boot: 2.8.3                  # Boot.clj
          bb: 0.7.8                    # Babashka
          clj-kondo: 2022.05.31        # Clj-kondo
          cljfmt: 0.10.2               # cljfmt
          cljstyle: 0.15.0             # cljstyle
          cmd-exe-workaround: 'latest' # Replaces `clojure` with `deps.clj` on Windows
          zprint: 1.2.3                # zprint
          
      # Optional step:
      - name: Cache clojure dependencies
        uses: actions/cache@v3
        with:
          path: |
            ~/.m2/repository
            ~/.gitlibs
            ~/.deps.clj
          # List all files containing dependencies:
          key: cljdeps-${{ hashFiles('deps.edn') }}
          # key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
          # key: cljdeps-${{ hashFiles('project.clj') }}
          # key: cljdeps-${{ hashFiles('build.boot') }}
          restore-keys: cljdeps-

      - name: Execute clojure code
        run: clojure -e "(+ 1 1)"
        
      - name: Get leiningen version
        run: lein -v
        
      - name: Get boot version
        run: boot -V

      - name: Get babashka version
        run: bb --version

      - name: Get clj-kondo version
        run: clj-kondo --version

      - name: Get cljfmt version
        run: cljfmt --version

      - name: Get cljstyle version
        # cljstyle is not yet available for windows
        if: ${{ matrix.os != 'windows-latest' }}
        run: cljstyle version

      - name: Get zprint version
        run: zprint --version

For more application cases please check Smoke Test Workflow file

License

The scripts and documentation in this project are released under the MIT License

setup-clojure's People

Contributors

cap10morgan avatar deining avatar delaguardo avatar dependabot[bot] avatar frenchy64 avatar hatappo avatar ikappaki avatar just-sultanov avatar mrebbinghaus avatar n2o avatar palloberg avatar rymndhng avatar weavejester avatar zharinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-clojure's Issues

set-env deprecation

repo keep warning about this when I will setup-clojure action

The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

404 on cljstyle

Hi, I think cljstyle changed the naming of their files:

"https://github.com/greglook/cljstyle/releases/download/0.16.626/cljstyle_0.16.626_linux.zip". Code(404) Message(Not Found)

Consider moving `pre` logic to the main entrypoint

It seems like pre-action feature breaks GitHub actions composability.
GitHub doesn't support YAML anchors feature that would decrease code duplication.

However, GitHub provides composite actions which are defined the similar way action.yml in this repo does, but instead of JavaScript code it depends on and runs another actions. You can think of it like higher-order action.

The problematic scenario is following:

  1. Define composite action in .github/actions/setup-clojure
name: 'Setup Clojure tooling'
description: 'Install Java, Clojure CLI and Babashka'
runs:
  using: "composite"
  steps:
    - uses: actions/[email protected]
      with:
        distribution: temurin
        java-version: 11

    - uses: DeLaGuardo/[email protected]
      with:
        cli: latest
        lein: latest
        bb: latest

    - name: Package cache
      uses: actions/[email protected]
      with:
        path: |
          ~/.m2/repository
          ~/.gitlibs
          ~/.deps.clj
        key: cljdeps-${{ hashFiles('project.clj', 'deps.edn', 'bb.edn') }}
        restore-keys: cljdeps-
  1. Use it from the workflow file .github/workflows/test in the same repository
- steps:
  # Essential if you're using locally-defined action
  - name: Checkout
    uses: actions/[email protected]
  
  - name: Setup Clojure tooling
    uses: ./github/actions/setup-clojure
  1. DeLaGuardo/[email protected] outputs warning and skips main entrypoint:
Warning: `pre` execution is not supported for local action from './.github/actions/setup-clojure'
  1. The entire workflow later fails with something like:
clojure: command not found

Clojure CLI downloads are moving to Github releases

I am preparing to move primary Clojure CLI downloads to Github releases. While I will continue publishing to download.clojure.org as a backup, Github should become the primary. This will require some changes in setup-clojure in cli.ts:

The latter two will now vary depending on when we've started publishing releases, so you can either do that with 1.11.1.1379 as the boundary or (better?) trying the github urls, then failing over to the download url. The brew recipe is being set up this way as well. Please let me know if you have any questions or find anything interesting while making this change.

question: what is unified cli input?

Hiya!

I am excited to see support for deps.exe (as clojure.exe) on Windows.
Thanks so much for adding that as a feature!

The current README suggests selecting via:

  cmd-exe-workaround: 'latest' # Replaces `clojure` with `deps.clj` on Windows

But the source code sez cmd-exe-workaround is deprecated

setup-clojure/action.yml

Lines 17 to 24 in 3199aaa

cmd-exe-workaround:
description: >+
[DEPRECATED]
On Windows platform, it will replace official Clojure CLI
with the `deps.clj` of its specific version, `latest` can be used.
Useful for running `clojure` command from `cmd.exe`.
deprecationMessage: 'No longer needed. Please remove and use unified `cli` input instead'

But I don't know what a "unified cli input" is.

Let's say I have a matrix build for macOS, Windows, and Linux, how should I select deps.exe (as clojure.exe) for windows?

@4.0: UnhandledPromiseRejectionWarning: Error: Unexpected HTTP response: 403

Run DeLaGuardo/[email protected]
[2](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:2)
  with:
[3](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:3)
    cli: 1.10.2
[4](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:4)
    github-token: ***
[5](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:5)
  env:
[6](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:6)
    JAVA_HOME: /opt/hostedtoolcache/GraalVM/21.0.0-java11-amd64/x64
[7](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:7)
    JAVA_HOME_21.0.0.java11.amd64: /opt/hostedtoolcache/GraalVM/21.0.0-java11-amd64/x64
[8](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:8)
    GRAALVM_HOME: /opt/hostedtoolcache/GraalVM/21.0.0-java11-amd64/x64
[9](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:9)
(node:1651) UnhandledPromiseRejectionWarning: Error: Unexpected HTTP response: 403
[10](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:10)
    at /home/runner/work/_actions/DeLaGuardo/setup-clojure/4.0/node_modules/@actions/tool-cache/lib/tool-cache.js:[11](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:11)4:1
11
    at Generator.next (<anonymous>)
[12](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:12)
    at fulfilled (/home/runner/work/_actions/DeLaGuardo/setup-clojure/4.0/node_modules/@actions/tool-cache/lib/tool-cache.js:24:42)
[13](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
[14](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:14)
(node:1651) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[15](https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true#step:4:15)
(node:1651) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

https://github.com/avelino/moclojer/runs/5322276602?check_suite_focus=true

invalidate-cache: true doesn't work on self-hosted runners

Self-hosted runners persist a lot more across runs vs. GitHub-provided runners. Currently the code just skips cache restoration to the runner's local FS when invalidate-cache: true is set. However, the cache is usually already present in its restored location on self-hosted runners. So an additional check is needed to ignore that w/ invalidate-cache: true. I'll work up a PR.

Are downloads cached?

Hi, I’m interested in using this action, but I can’t tell whether it caches Clojure and whichever tools are specified (in my case it’d be tools.deps along with the CLI tools.) I’m generally uncomfortable with automations that download the same dependencies every time they run, so I personally tend to include very comprehensive caching in my automations (example).

I did search the code and saw that it’s using @actions/tool-cache which seems promising, but when I read the docs I found this:

Finally, you can cache these directories in our tool-cache. This is useful if you want to switch back and forth between versions of a tool, or save a tool between runs for self-hosted runners.

(emphasis mine)

This seems to imply that @actions/tool-cache does not actually, you know, cache anything, when running on GitHub’s runners. But of course, there’s a very good chance I’m just missing something here.

Bottom line: does this action currently its downloads when running on GitHub’s runners?

Thank you!

API rate limit exceeded while resolving action `DeLaGuardo/setup-clojure@master`

Hello, thank you so much for you very kindly put together, I've been using this great project with no second thoughts. I'm rather sorry to be the one who brings that kind of annoying news, but while using this action I hit a API rate limit. Here is a more complete error message, as reported in GitHub workflow run log:

API rate limit exceeded while resolving action DeLaGuardo/setup-clojure@master.. API rate limit exceeded while resolving action actions/cache@v2.. API rate limit exceeded while resolving action actions/checkout@main.. API rate limit exceeded while resolving action piotr-yuxuan/walter-ci@main.

The action piotr-yuxuan/walter-ci is mine, it's just a pet project I've been tinkering with. However, if I read correctly the log, it means that piotr-yuxuan/walter-ci tries to resolve DeLaGuardo/setup-clojure and get an issue. I'm not sure, but out of nowhere my initial guess would be to look more around this line: https://github.com/DeLaGuardo/setup-clojure/blob/master/src/cli.ts#L13. Did you observe any similar behaviour elsewhere?

Some other setup-* actions got the same issue, for example: actions/setup-go#16

Cheers
胡雨軒 Петр

"Bad Credentials" fetching clj-kondo

I am trying to run the following workflow on Gitea/Forgejo actions.

name: clj-kondo checks
on: [push]
jobs:
  self-lint:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Set up clj-kondo
      uses: https://github.com/DeLaGuardo/setup-clojure@master
      with:
        clj-kondo: latest

    - name: Run clj-kondo
      run: clj-kondo --lint src

This steps exactly at the "Set up clj-kondo" step with the following logs

[clj-kondo checks/self-lint] [DEBUG] executing remote job container: [node /var/run/act/actions/https---github.com-DeLaGuardo-setup-clojure@master/dist/index.js]
[clj-kondo checks/self-lint]   🐳  docker exec cmd=[node /var/run/act/actions/https---github.com-DeLaGuardo-setup-clojure@master/dist/index.js] user= workdir=
[clj-kondo checks/self-lint] [DEBUG] Exec command '[node /var/run/act/actions/https---github.com-DeLaGuardo-setup-clojure@master/dist/index.js]'
[clj-kondo checks/self-lint] [DEBUG] Working directory '/data/.cache/act/bunseki/backend-model'
[clj-kondo checks/self-lint]   ❗  ::error::Bad credentials
[clj-kondo checks/self-lint]   | ::error::Bad credentials
[clj-kondo checks/self-lint]   ❌  Failure - Main Set up clj-kondo
[clj-kondo checks/self-lint] exitcode '1': failure

Support for arm64 runners

I used this in a linux/arm64 self-hosted runner to install babashka but it installed the x86-64 version, not arm64.

$ file _work/_tool/Babashka/0.9.161/arm64/bb
_work/_tool/Babashka/0.9.161/arm64/bb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped

boot support for MS-Windows

Hi,

is there a technical reason why boot is not supported for MS-Windows? boot.exe appears to behave similar to boot.sh which is currently in use. Both available from the same source at https://github.com/boot-clj/boot-bin/releases.

      - name: Get boot version
        # Boot is not yet available for windows
        if: ${{ matrix.os != 'windows-latest' }}
        run: boot -V

Thanks

Clojure install error after boot.exe/cache update

Hi,

I'm getting the following error with latest mainline after #58

Run DeLaGuardo/setup-clojure@master

Leiningen found in cache C:\hostedtoolcache\windows\Leiningen\2.9.1-9-0\x64
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -c "iwr -useb download.clojure.org/install/win-install-1.10.3.1013.ps1 | iex"
C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.342-7\x64\bin\java.exe -cp dist JavaVersion
Error: Could not find or load main class JavaVersion
Error: The process 'C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.342-7\x64\bin\java.exe' failed with exit code 1

to reproduce, use the following action

jobs:
  cross-platform:
    runs-on: ${{matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-latest]
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 0


      - name: Prepare java
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: '8'

      - name: Install Clojure
        uses: DeLaGuardo/setup-clojure@master
        with:
          cli: 1.10.3.1013
          lein: 2.9.1
          bb: 0.8.157
          boot: 2.8.3

can't spot something wrong with the action def ...

corresponding java install log output

Run actions/setup-java@v3

Trying to resolve the latest version from remote
Resolved latest version as 8.0.342+7

Trying to download...

Downloading Java 8.0.342+7 (Zulu) from https://cdn.azul.com/zulu/bin/zulu8.64.0.15-ca-jdk8.0.342-win_x64.zip ...

Extracting Java archive...

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\4cbbb769-8ec7-4225-9a81-2dcbc3e3bcff', 'D:\a\_temp\7ccfa74a-c337-4dcb-a07f-a4af3d532fb6')"

Java 8.0.342+7 was downloaded

Setting Java 8.0.342+7 as the default
Java configuration:
  Distribution: zulu
  Version: 8.0.342+7
  Path: C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.342-7\x64
Creating settings.xml with server-id: github
Writing to C:\Users\runneradmin\.m2\settings.xml

Thanks

Update to node 16+

I've been seeing this warning in GitHub Actions annotations:

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: DeLaGuardo/[email protected]. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

Clojure cli tools are not available on the Windows pwsh shell

Hi,

the Clojure cli tools on windows are installed on a location that is only available to the powershell shell but not available to the pwsh shell. The latter is also the default GitHub Action shell on windows, and as such calling Clojure will fail when a shell is not specified:

clojure --version

     The term 'clojure' is not recognized as a name of a cmdlet, function, script file, or executable
    program. Check the spelling of the name, or if a path was included, verify that the path is correct
     and try again.

to reproduce, create a job running Clojure with the default shell:

jobs:
  cross-platform:
    runs-on: ${{matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-latest]
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 0

      - name: Prepare java
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: '8'

      - name: Install Clojure
        uses: DeLaGuardo/setup-clojure@master
        with:
          cli: 1.10.3.1013

      - name: test
        run: |
          clojure --version

it will error out with the previous message.

This also has the annoying effect that one has to specify two slightly different jobs when running cross platform tests with the same run body.

PR to follow.

thanks

Prerelease version of clojure tdeps has an extra jar. Can we include it?

Starting with 1.10.1.693 there is an extra jar (exec.jar) for the tdeps install. Is it possible to include this so that everything can work properly? There may be other extra files, I didn't evaluate all the differences, but exec.jar is the big one

I love this action. Thanks!

echo "Installing libs into $clojure_lib_dir"
install -Dm644 clojure-tools/deps.edn "$clojure_lib_dir/deps.edn"
install -Dm644 clojure-tools/example-deps.edn "$clojure_lib_dir/example-deps.edn"
install -Dm644 clojure-tools/exec.jar "$clojure_lib_dir/libexec/exec.jar"
install -Dm644 clojure-tools/clojure-tools-1.10.1.693.jar "$clojure_lib_dir/libexec/clojure-tools-1.10.1.693.jar"

leiningen classpath not set correctly

I'm impacted by leiningen 2.11.0 breaking some plugins, and need to force lein 2.10.0 for now.

NOTE: This issue is not about the classpath for my project. The issue is the classpath from which the leiningen jar is found.

Here is my github actions configuration:

name: booboo
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-java@v3
      with:
        distribution: "corretto"
        java-version: "17"
        # cache: "maven"
        # cache-dependency-path: 'clj/project.clj'
    - uses: DeLaGuardo/[email protected]
      with:
        lein: 2.10.0
    - name: Run tests
      run: cd clj; which lein; DEBUG=true lein test

The output shows like this:

Run DeLaGuardo/[email protected]
  with:
    lein: 2.10.0
    github-token: ***
    invalidate-cache: false
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Corretto_jdk/17.0.10-7.1/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Corretto_jdk/17.0.10-7.1/x64
  
/home/runner/work/_temp/temp_1735711811/leiningen/bin/lein version
Downloading Leiningen to /home/runner/work/_temp/temp_1735711811/leiningen/self-installs/leiningen-2.10.0-standalone.jar now...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  1 12.1M    1  173k    0     0   706k      0  0:00:17 --:--:--  0:00:17  706k
100 12.1M  100 12.1M    0     0  22.4M      0 --:--:-- --:--:-- --:--:-- 40.6M
/home/runner/work/_temp/temp_17357118)11/leiningen/self-installs/leiningen-2.10.0-standalone.jar.pending: OK
Leiningen 2.10.0 on Java 17.0.10 OpenJDK 64-Bit Server VM
/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/bridge-telemetry/bridge-telemetry --files-from manifest.txt --use-compress-program zstdmt
Cache Size: ~11 MB (11424450 B)
Cache saved successfully

so far so good... then

> Run cd clj; which lein; DEBUG=true lein test
  cd clj; which lein; DEBUG=true lein test
  shell: /usr/bin/bash -e {0}
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Corretto_jdk/17.0.10-7.1/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Corretto_jdk/17.0.10-7.1/x64
    LEIN_HOME: /opt/hostedtoolcache/Leiningen/2.10.0-12-3/x64
/opt/hostedtoolcache/Leiningen/2.10.0-12-3/x64/bin/lein
Leiningen's classpath: /usr/local/lib/lein/self-installs/leiningen-2.11.1-standalone.jar
...

Kindly note the line reading Leiningen's classpath, showing leiningen-2.11.1-standalone.jar.

As a result, I'm still impacted by the bug in lein's 2.11.1 version.

set-env and add-path commands are disabled

Currently set-env and add-path commands are disabled on GitHub Actions.
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Error: Unable to process command '::set-env name=CLOJURE_INSTALL_DIR,::/opt/hostedtoolcache/ClojureToolsDeps/1.10.1-536/x64/lib/clojure' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: Unable to process command '::add-path::/opt/hostedtoolcache/ClojureToolsDeps/1.10.1-536/x64/bin' successfully.
Error: The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Babashka Support

Would you be open to adding babashka as another tool? Babashka provides a handy way to write the build scripts in clojure, for my use case anyway.

CLI setup does not copy tools.edn file

This makes it impossible to use clojure -Ttools operations in CI because the install tools.edn is not present, so the first-run check in clojure doesn't copy it to the user config folder, so no tools operations work.

Update `actions/setup-java` version in readme

According to the upgrade guide, we might want to update this part of the README:

      - name: Prepare java
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

to

      - name: Prepare java
        uses: actions/setup-java@v2
        with:
          distribution: 'zulu'
          java-version: '8'

I haven't tested this yet, but I often copy this template for new builds.

latest for cli should only use latest stable version

I just had an issue where someone using cli: latest got the new alpha version that I released last night and are seeing issues due to changes in the alpha. The CLI has both dev and stable versions, and imo the cli: latest should only give you latest stable as we often have interim unstable releases.

I see in the code you're basing this on the Windows powershell installer version. That's probably on the path to deprecation and removal so this current strategy is likely to be broken eventually anyways. There are a couple of places you can look to find the latest stable version. One is here: https://github.com/clojure/homebrew-tools/blob/master/Formula/clojure.rb

And I have just created a new place here:
https://download.clojure.org/install/stable.properties

Windows support

This is working fine for both Mac and Linux, that's great! However, with Windows it says that that isn't supported yet. Do you have plans to implement that soon? Thanks

Support babashka?

Would be lovely to have one canonical GH action that supports doing cached installs of different Clojure CLI tools.

There's a few setup-babashka projects, but why not just integrate it here as well, seems like it would be similar to other tools?

Use of deprecated commands?

My build (which has been working for ~6 months) just stopped working, with this error:

The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

In looking at the linked blog post, it appears that some changes are necessary in the workflow action to ensure it continues to function correctly.

Support for using `clj`

Currently if we use clj instead of clojure, it will give this error

Please install rlwrap for command editing or use "clojure" instead.
make: *** [check] Error 1
Makefile:10: recipe for target 'check' failed

API Rate Limit exceeded errors

On several projects using setup-clojure I've been encountering occasional failures from API rate limits.

As example:

Run DeLaGuardo/[email protected]
  with:
    cli: latest
    bb: latest
    github-token: ***
    invalidate-cache: false
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.9-9/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.9-9/x64

API rate limit exceeded for $IPADDRESS. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

Unfortunately, it's not clear from the error what documentation needs to be checked in order to authenticate for a higher rate limit.

It looks like this was previously encountered in #40 but was then removed in #45. From the error message I can't be sure, but I wonder if the fetch step for CLI is passing the token correctly but the corresponding logic for fetching babashka is not using a token?

I'm also using caching, but I'm curious if using latest instead of a specific version might be forcing cache misses.

Thank you very much for this very useful github action, hopefully we can find a solution to address the sporadic failures.

tests never completing

I use an interactive test runner. This never completes with setup-clojure in github actions.

:test-clj {:extra-paths ["test"]
             :extra-deps  {eftest/eftest {:mvn/version "0.5.7"}}
             :main-opts   ["-e"  "(require,'[eftest.runner,:refer,[find-tests,run-tests]]),(run-tests,(find-tests,\"test\"))"]}

build now failing due to github blocking set-env

Hi,

From today, November 16 2020, github has blocked all set-env commands from working, i.e.,

The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

This is now causing the action to fail to build projects:

Unable to process command '::set-env name=CLOJURE_INSTALL_DIR,::/opt/hostedtoolcache/ClojureToolsDeps/1.10.1-708/x64/lib/clojure' successfully.

and

The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

and

Run DeLaGuardo/[email protected]
/bin/tar xz -C /home/runner/work/_temp/temp_898646021 -f /home/runner/work/_temp/c1015bd7-c452-4207-b9fd-c514fc8975d0
Error: Unable to process command '::set-env name=CLOJURE_INSTALL_DIR,::/opt/hostedtoolcache/ClojureToolsDeps/1.10.1-708/x64/lib/clojure' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: Unable to process command '::add-path::/opt/hostedtoolcache/ClojureToolsDeps/1.10.1-708/x64/bin' successfully.
Error: The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Is there a remediation for this?

docs imply cli does not support 'latest'

Hiya! Thanks so much for these great GitHub Action setup tools!

One small thing I noticed is that the README gives this example:

      - name: Install clojure tools
        uses: DeLaGuardo/[email protected]
        with:
          # Install just one or all simultaneously
          cli: 1.10.1.693 # Clojure CLI based on tools.deps
          lein: 2.9.1     # or use 'latest' to always provision latest version of leiningen
          boot: 2.8.3     # or use 'latest' to always provision latest version of boot
          bb: 0.7.8       # or use 'latest' to always provision latest version of babashka

Which to me implies that cli: does not support 'latest', but maybe it does?

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.