{"id":26600921,"url":"https://github.com/jiro4989/setup-nim-action","last_synced_at":"2026-01-08T12:13:57.702Z","repository":{"id":37797679,"uuid":"221683538","full_name":"jiro4989/setup-nim-action","owner":"jiro4989","description":"Set up your GitHub Actions workflow with a specific version of Nim","archived":false,"fork":false,"pushed_at":"2024-09-15T16:05:47.000Z","size":92362,"stargazers_count":105,"open_issues_count":3,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-22T03:31:25.596Z","etag":null,"topics":["ci","github-actions","javascript","nim","typescript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiro4989.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-14T11:38:41.000Z","updated_at":"2024-10-06T11:35:58.000Z","dependencies_parsed_at":"2023-02-17T08:45:35.656Z","dependency_job_id":"354b3e3e-18e4-4430-ab8f-c3e14a15f4b8","html_url":"https://github.com/jiro4989/setup-nim-action","commit_stats":{"total_commits":464,"total_committers":8,"mean_commits":58.0,"dds":0.4676724137931034,"last_synced_commit":"3a60cf06f20c1cf3a9becf76b30288c0361d5f1e"},"previous_names":[],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fsetup-nim-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fsetup-nim-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fsetup-nim-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fsetup-nim-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiro4989","download_url":"https://codeload.github.com/jiro4989/setup-nim-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","github-actions","javascript","nim","typescript"],"created_at":"2025-03-23T18:36:03.760Z","updated_at":"2026-01-08T12:13:57.672Z","avatar_url":"https://github.com/jiro4989.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :crown:setup-nim-action\n\n![Build Status](https://github.com/jiro4989/setup-nim-action/workflows/build/badge.svg)\n\nThis action sets up a [Nim-lang](https://nim-lang.org/):crown: environment.\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [`v2` version was released :tada:](#v2-version-was-released-tada)\n* [Migration to v2 from v1](#migration-to-v2-from-v1)\n  * [Q\u0026A](#qa)\n    * [getAppFilename failed](#getappfilename-failed)\n* [:mag_right:Usage](#mag_rightusage)\n  * [Basic usage](#basic-usage)\n  * [Setup a latest patch version Nim](#setup-a-latest-patch-version-nim)\n  * [Setup a latest minor version Nim](#setup-a-latest-minor-version-nim)\n  * [Cache usage](#cache-usage)\n  * [Matrix testing usage](#matrix-testing-usage)\n  * [`devel` usage](#devel-usage)\n  * [Change Nim installation directory](#change-nim-installation-directory)\n  * [Full example](#full-example)\n* [:hammer:Development](#hammerdevelopment)\n* [:page_facing_up:License](#page_facing_uplicense)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## `v2` version was released :tada:\n\nsetup-nim-action has released `v2` ( \u003chttps://github.com/jiro4989/setup-nim-action/pull/491\u003e ).\n\nsetup-nim-action `v1` depended on `choosenim`.\nOne day, an issue occurred that installation became very slow with `choosenim` ( \u003chttps://github.com/jiro4989/setup-nim-action/issues/483\u003e ).\nThis process took between 6 and 20 minutes.\n\nI changed setup-nim-action so that is does not use choosenim to solve this problem.\n\n## Migration to v2 from v1\n\n1. Upgrade version of `setup-nim-action` to `v2` from `v1`\n1. Change cache key to clear cache if you are using it.\n   The key can be anything if the cache will be cleared.\n   Nothing to do if you are not using `actions/cache`\n1. Remove caching `choosenim` if you are using it.\n   `setup-nim-action` does not use choosenim now.\n   Nothing to do if you are not caching `choosenim`\n1. Remove `yes` and `no-color` parameters if you are using it.\n   These parameters are not used now.\n   Nothing to do if you are not these parameters\n\n```diff\n steps:\n   - uses: actions/checkout@v4\n\n   - name: Cache nimble\n     id: cache-nimble\n     uses: actions/cache@v4\n     with:\n       path: ~/.nimble\n-      key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}\n+      key: ${{ runner.os }}-nimble-v2-${{ hashFiles('*.nimble') }}\n       restore-keys: |\n-        ${{ runner.os }}-nimble-\n+        ${{ runner.os }}-nimble-v2-\n     if: runner.os != 'Windows'\n\n-  - name: Cache choosenim\n-    id: cache-choosenim\n-    uses: actions/cache@v4\n-    with:\n-      path: ~/.choosenim\n-      key: ${{ runner.os }}-choosenim-${{ matrix.cache-key }}-${{ steps.get-date.outputs.date }}\n-      restore-keys: |\n-        ${{ runner.os }}-choosenim-${{ matrix.cache-key }}-\n\n-  - uses: jiro4989/setup-nim-action@v1\n+  - uses: jiro4989/setup-nim-action@v2\n     with:\n       nim-version: '2.0.0' # default is 'stable'\n+      repo-token: ${{ secrets.GITHUB_TOKEN }}\n-      yes: false\n-      no-color: yes\n   - run: nimble build -Y\n   - run: nimble test -Y\n```\n\n### Q\u0026A\n\n#### getAppFilename failed\n\nPlease clear cache if you get the following error.\n\n\u003e getAppFilename failed. (Error was: Unable to read /home/runner/.choosenim/current. (Error was: No installation has been chosen. (File missing: /home/runner/.choosenim/current)))\n\nCache is cleared if you change cache key.\n\n```diff\n     uses: actions/cache@v4\n     with:\n       path: ~/.nimble\n-      key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}\n+      key: ${{ runner.os }}-nimble-v2-${{ hashFiles('*.nimble') }}\n       restore-keys: |\n-        ${{ runner.os }}-nimble-\n+        ${{ runner.os }}-nimble-v2-\n     if: runner.os != 'Windows'\n```\n\nOr please remove actions/cache.\n\n```diff\n-    uses: actions/cache@v4\n-    with:\n-      path: ~/.nimble\n-      key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}\n-      restore-keys: |\n-        ${{ runner.os }}-nimble-\n-    if: runner.os != 'Windows'\n```\n\n## :mag_right:Usage\n\nSee [action.yml](action.yml)\n\n### Basic usage\n\n```yaml\nsteps:\n  - uses: actions/checkout@v4\n  - uses: jiro4989/setup-nim-action@v2\n    with:\n      nim-version: '2.0.0' # default is 'stable'\n      repo-token: ${{ secrets.GITHUB_TOKEN }}\n  - run: nimble build -Y\n  - run: nimble test -Y\n```\n\n`repo-token` is using for [Rate limiting](https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting).\nIt works without setting this parameter, but please set it if the following error message is returned.\n\n\u003e Error: 403 - {\"message\":\"API rate limit exceeded for nn.nn.nn.nnn. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\"documentation_url\":\"\u003chttps://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting\"}\u003e\n\n### Setup a latest patch version Nim\n\nSetup a latest patch version Nim when `nim-version` is `2.n.x` .\n\n```yaml\nsteps:\n  - uses: actions/checkout@v4\n  - uses: jiro4989/setup-nim-action@v2\n    with:\n      nim-version: '2.0.x' # ex: 1.0.x, 1.2.x, 1.4.x, 2.0.x ...\n      repo-token: ${{ secrets.GITHUB_TOKEN }}\n  - run: nimble build -Y\n  - run: nimble test -Y\n```\n\n### Setup a latest minor version Nim\n\nSetup a latest minor version Nim when `nim-version` is `2.x` .\n\n```yaml\nsteps:\n  - uses: actions/checkout@v4\n  - uses: jiro4989/setup-nim-action@v2\n    with:\n      nim-version: '2.x'\n      repo-token: ${{ secrets.GITHUB_TOKEN }}\n  - run: nimble build -Y\n  - run: nimble test -Y\n```\n\n### Cache usage\n\n```yaml\nsteps:\n  - uses: actions/checkout@v4\n  - name: Cache nimble\n    id: cache-nimble\n    uses: actions/cache@v4\n    with:\n      path: ~/.nimble\n      key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}\n      restore-keys: |\n        ${{ runner.os }}-nimble-\n    if: runner.os != 'Windows'\n  - uses: jiro4989/setup-nim-action@v2\n    with:\n      repo-token: ${{ secrets.GITHUB_TOKEN }}\n  - run: nimble build -Y\n  - run: nimble test -Y\n```\n\n### Matrix testing usage\n\nIf you want to support multiple Nim versions or multiple platforms, `strategy.matrix` is useful.\n\ne.g. Tests multiple Nim versions:\n\n```yaml\njobs:\n  build:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        nim:\n          - '1.2.0'\n          - '1.2.x'\n          - '1.4.x'\n          - '1.6.x'\n          - '2.0.x'\n          - 'stable'\n          - 'devel'\n    name: Nim ${{ matrix.nim }} sample\n    steps:\n      - uses: actions/checkout@v4\n      - name: Setup nim\n        uses: jiro4989/setup-nim-action@v2\n        with:\n          nim-version: ${{ matrix.nim }}\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n      - run: nimble build -Y\n      - run: nimble test -Y\n```\n\ne.g. Tests multiple platforms:\n\n```yaml\njobs:\n  build:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os:\n          - ubuntu-latest\n          - windows-latest\n          - macOS-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Setup nim\n        uses: jiro4989/setup-nim-action@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n      - run: nimble build -Y\n      - run: nimble test -Y\n```\n\ne.g. Tests multiple Nim versions and platforms:\n\n:warning: **WARN** :warning: Depending on matrix count, the number of test jobs may be very large.\nIt is recommend to keep the small matrix count.\n\n```yaml\njobs:\n  build:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        nim:\n          - '1.4.x'\n          - '1.6.x'\n          - '2.0.x'\n          - 'stable'\n        os:\n          - ubuntu-latest\n          - windows-latest\n          - macOS-latest\n    name: Nim ${{ matrix.nim }} sample\n    steps:\n      - uses: actions/checkout@v4\n      - name: Setup nim\n        uses: jiro4989/setup-nim-action@v2\n        with:\n          nim-version: ${{ matrix.nim }}\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n      - run: nimble build -Y\n      - run: nimble test -Y\n```\n\n### `devel` usage\n\nUse `devel` version if you want to use devel compiler of Nim.\nsetup-nim-action will fetch the devel source code and build the nim compiler every time.\n\n```yaml\njobs:\n  test_devel:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Cache nimble\n        id: cache-nimble\n        uses: actions/cache@v4\n        with:\n          path: ~/.nimble\n          key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}\n          restore-keys: |\n            ${{ runner.os }}-nimble-\n\n      - uses: jiro4989/setup-nim-action@v2\n        with:\n          nim-version: devel\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n\n      - run: nimble build -Y\n```\n\nBut building the devel compiler takes a long time.\nIf you don't want to build it every time, set `use-nightlies` to `true`.\n\n```yaml\njobs:\n  test_devel:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Cache nimble\n        id: cache-nimble\n        uses: actions/cache@v4\n        with:\n          path: ~/.nimble\n          key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}\n          restore-keys: |\n            ${{ runner.os }}-nimble-\n\n      - uses: jiro4989/setup-nim-action@v2\n        with:\n          nim-version: devel\n          use-nightlies: true\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n\n      - run: nimble build -Y\n```\n\n### Change Nim installation directory\n\n`setup-nim-action` installs Nim to `.nim_runtime` directory of current directory.\nYou can use `parent-nim-install-directory` and `nim-install-directory` parameters if you want to change it.\n\nUse `parent-nim-install-directory` if you want to install nim to temporary directory.\nThis example installs nim to `/home/runner/work/_temp/.nim_runtime`.\n\n```yaml\n  - uses: jiro4989/setup-nim-action@v2\n    with:\n      nim-version: stable\n      repo-token: ${{ secrets.GITHUB_TOKEN }}\n      parent-nim-install-directory: ${{ runner.temp }}\n```\n\nUse `nim-install-directory` if you want to change base directory name.\nThis example installs nim to `$PWD/nim_compiler`.\n\n```yaml\n  - uses: jiro4989/setup-nim-action@v2\n    with:\n      nim-version: stable\n      repo-token: ${{ secrets.GITHUB_TOKEN }}\n      nim-install-directory: nim_compiler\n```\n\n### Full example\n\nSee [.github/workflows/test.yml](.github/workflows/test.yml).\n\n## :hammer:Development\n\nThis project uses shell script only.\nRun `script/format.sh` when you edited source code.\n\n```bash\nvim install_nim.sh\n./script/format.sh\n```\n\n## :page_facing_up:License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fsetup-nim-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiro4989%2Fsetup-nim-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fsetup-nim-action/lists"}