{"id":23613646,"url":"https://github.com/freckle/stack-action","last_synced_at":"2026-01-28T11:14:55.108Z","repository":{"id":37038277,"uuid":"331030931","full_name":"freckle/stack-action","owner":"freckle","description":"GitHub Action to build, test, and lint Stack-based Haskell projects","archived":false,"fork":false,"pushed_at":"2025-05-06T12:12:05.000Z","size":1419,"stargazers_count":22,"open_issues_count":3,"forks_count":4,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-06T13:25:46.648Z","etag":null,"topics":["ghvm-managed","github-actions","haskell","stack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/freckle.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-19T15:50:44.000Z","updated_at":"2025-04-28T12:30:11.000Z","dependencies_parsed_at":"2024-02-12T15:14:42.578Z","dependency_job_id":"53530b98-b536-482c-9ebd-998478ad4319","html_url":"https://github.com/freckle/stack-action","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freckle%2Fstack-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freckle%2Fstack-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freckle%2Fstack-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freckle%2Fstack-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freckle","download_url":"https://codeload.github.com/freckle/stack-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253827690,"owners_count":21970566,"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":["ghvm-managed","github-actions","haskell","stack"],"created_at":"2024-12-27T17:18:36.371Z","updated_at":"2026-01-28T11:14:55.061Z","avatar_url":"https://github.com/freckle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stack Action\n\nGitHub Action to build and test a stack-based Haskell project.\n\n## Usage\n\n```yaml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: freckle/stack-action@v5\n```\n\n## Notable Changes in v5\n\nAs of version 5, the single `stack-arguments` input has been broken up into\nvarious, distinct `stack-[*-]arguments[-*]` inputs that are used in more\nspecific ways. See the _Inputs_ section, or `action.yml` for documentation of\nthe new options.\n\nThe `fast` and `pedantic` inputs were removed. Use a ternary operator (see\n[Operators](https://docs.github.com/en/actions/learn-github-actions/expressions#operators))\nto pass a flag conditionally. Example:\n\n```yaml\nstack-build-arguments: ${{ github.ref_name != 'main' \u0026\u0026 '--fast' || '' }} --pedantic\n```\n\n## Notable Changes in v4\n\nAs of version 4, this action automatically handles caching. You do not need to\nuse a separate `stack-cache-action` step any more.\n\n## Notable Changes in v3\n\nPrevious versions of this Action ran HLint and Weeder for you. We recommend\ndoing that as separate actions now, so, as of `v3`, those options have been\nremoved.\n\nHere is an example of running separate Actions:\n\n```yaml\njobs:\n  test:\n    # ...\n    steps:\n      - uses: actions/checkout@v4\n      - id: stack\n        uses: freckle/stack-action@v5\n\n      # Weeder requires running in the same Job (to access .hie artifacts)\n      - uses: freckle/weeder-action@v2\n        with:\n          ghc-version: ${{ steps.stack.outputs.compiler-version }}\n\n  # HLint can be a distinct Job, possibly limited to changed files\n  hlint:\n    # ...\n    steps:\n      - uses: actions/checkout@v4\n      - uses: haskell-actions/hlint-setup@v1\n      - uses: haskell-actions/hlint-run@v2\n```\n\n\u003c!-- action-docs-inputs action=\"action.yml\" --\u003e\n\n## Inputs\n\n| name                                 | description                                                                                                                                                                                                                                    | required | default             |\n| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------- |\n| `working-directory`                  | \u003cp\u003eWorking directory for run commands\u003c/p\u003e                                                                                                                                                                                                      | `false`  | `\"\"`                |\n| `test`                               | \u003cp\u003eWhether to run tests\u003c/p\u003e                                                                                                                                                                                                                    | `false`  | `true`              |\n| `color`                              | \u003cp\u003eWhether to force \u003ccode\u003e--color=always\u003c/code\u003e\u003c/p\u003e                                                                                                                                                                                            | `false`  | `true`              |\n| `stack-arguments`                    | \u003cp\u003eAdditional arguments for all top-level \u003ccode\u003estack\u003c/code\u003e command invocations.\u003c/p\u003e                                                                                                                                                          | `false`  | `\"\"`                |\n| `stack-query-arguments`              | \u003cp\u003eAdditional arguments in \u003ccode\u003estack query\u003c/code\u003e invocations.\u003c/p\u003e                                                                                                                                                                           | `false`  | `\"\"`                |\n| `stack-path-arguments`               | \u003cp\u003eAdditional arguments in \u003ccode\u003estack path\u003c/code\u003e invocations.\u003c/p\u003e                                                                                                                                                                            | `false`  | `\"\"`                |\n| `stack-setup-arguments`              | \u003cp\u003eAdditional arguments in \u003ccode\u003estack setup\u003c/code\u003e invocations.\u003c/p\u003e                                                                                                                                                                           | `false`  | `\"\"`                |\n| `stack-build-arguments`              | \u003cp\u003eAdditional arguments for all \u003ccode\u003estack build\u003c/code\u003e invocations.\u003c/p\u003e                                                                                                                                                                      | `false`  | `--fast --pedantic` |\n| `stack-build-arguments-dependencies` | \u003cp\u003eAdditional arguments passed after \u003ccode\u003estack-build-arguments\u003c/code\u003e in \u003ccode\u003estack build\u003c/code\u003e invocations on the \u003cem\u003eDependencies\u003c/em\u003e step.\u003c/p\u003e                                                                                         | `false`  | `\"\"`                |\n| `stack-build-arguments-build`        | \u003cp\u003eAdditional arguments passed after \u003ccode\u003estack-build-arguments\u003c/code\u003e in \u003ccode\u003estack build\u003c/code\u003e invocations on the \u003cem\u003eBuild\u003c/em\u003e step.\u003c/p\u003e                                                                                                | `false`  | `\"\"`                |\n| `stack-build-arguments-test`         | \u003cp\u003eAdditional arguments passed after \u003ccode\u003estack-build-arguments\u003c/code\u003e in \u003ccode\u003estack build\u003c/code\u003e invocations on the \u003cem\u003eTest\u003c/em\u003e step.\u003c/p\u003e                                                                                                 | `false`  | `\"\"`                |\n| `cache-prefix`                       | \u003cp\u003ePrefix applied to all cache keys. This can be any value you like, but teams often use \u003ccode\u003ev{N}\u003c/code\u003e and bump it to \u003ccode\u003ev{N+1}\u003c/code\u003e when/if they need to explicitly bust caches.\u003c/p\u003e                                                 | `false`  | `\"\"`                |\n| `cache-save-always`                  | \u003cp\u003eSave artifacts to the cache even if the build fails. This may speed up builds in subsequent runs at the expense of slightly-longer builds when a full cache-hit occurs. Since \u003ccode\u003e@v4.2.0\u003c/code\u003e.\u003c/p\u003e                                     | `false`  | `false`             |\n| `on-dirty-files`                     | \u003cp\u003eWhat to do if we find changes to the cabal or lock file after a build. Value can be \u003ccode\u003ewarn\u003c/code\u003e, or \u003ccode\u003eerror\u003c/code\u003e. Default is \u003ccode\u003ewarn\u003c/code\u003e.\u003c/p\u003e                                                                             | `false`  | `warn`              |\n| `install-stack`                      | \u003cp\u003eInstall stack, if necessary\u003c/p\u003e                                                                                                                                                                                                             | `false`  | `true`              |\n| `upgrade-stack`                      | \u003cp\u003eUpgrade stack\u003c/p\u003e                                                                                                                                                                                                                           | `false`  | `true`              |\n| `compiler-tools`                     | \u003cp\u003eA list of packages to install as compiler tools, one per line. This is useful to do here rather than separate \u003ccode\u003erun\u003c/code\u003e commands so that their installation is incorporated in the dependency cache. Since \u003ccode\u003e@v5.2.0\u003c/code\u003e.\u003c/p\u003e | `false`  | `\"\"`                |\n| `stack-yaml`                         | \u003cp\u003e\u003cstrong\u003eDeprecated\u003c/strong\u003e use \u003ccode\u003eenv.STACK_YAML\u003c/code\u003e or \u003ccode\u003estack-arguments\u003c/code\u003e instead.\u003c/p\u003e                                                                                                                                    | `false`  | `\"\"`                |\n\n\u003c!-- action-docs-inputs action=\"action.yml\" --\u003e\n\n## Outputs\n\n| name                    | description                                                                  |\n| ----------------------- | ---------------------------------------------------------------------------- |\n| `compiler`              | \u003cp\u003e\u003ccode\u003ecompiler.actual\u003c/code\u003e value from stack query\u003c/p\u003e                   |\n| `compiler-version`      | \u003cp\u003eThe GHC version part of compiler\u003c/p\u003e                                      |\n| `snapshot-doc-root`     | \u003cp\u003e\u003ccode\u003esnapshot-doc-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e     |\n| `local-doc-root`        | \u003cp\u003e\u003ccode\u003elocal-doc-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e        |\n| `local-hoogle-root`     | \u003cp\u003e\u003ccode\u003elocal-hoogle-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e     |\n| `stack-root`            | \u003cp\u003e\u003ccode\u003estack-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e            |\n| `project-root`          | \u003cp\u003e\u003ccode\u003eproject-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e          |\n| `config-location`       | \u003cp\u003e\u003ccode\u003econfig-location\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e       |\n| `bin-path`              | \u003cp\u003e\u003ccode\u003ebin-path\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e              |\n| `programs`              | \u003cp\u003e\u003ccode\u003eprograms\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e              |\n| `compiler-exe`          | \u003cp\u003e\u003ccode\u003ecompiler-exe\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e          |\n| `compiler-bin`          | \u003cp\u003e\u003ccode\u003ecompiler-bin\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e          |\n| `compiler-tools-bin`    | \u003cp\u003e\u003ccode\u003ecompiler-tools-bin\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e    |\n| `local-bin`             | \u003cp\u003e\u003ccode\u003elocal-bin\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e             |\n| `extra-include-dirs`    | \u003cp\u003e\u003ccode\u003eextra-include-dirs\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e    |\n| `extra-library-dirs`    | \u003cp\u003e\u003ccode\u003eextra-library-dirs\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e    |\n| `snapshot-pkg-db`       | \u003cp\u003e\u003ccode\u003esnapshot-pkg-db\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e       |\n| `local-pkg-db`          | \u003cp\u003e\u003ccode\u003elocal-pkg-db\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e          |\n| `global-pkg-db`         | \u003cp\u003e\u003ccode\u003eglobal-pkg-db\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e         |\n| `ghc-package-path`      | \u003cp\u003e\u003ccode\u003eghc-package-path\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e      |\n| `snapshot-install-root` | \u003cp\u003e\u003ccode\u003esnapshot-install-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e |\n| `local-install-root`    | \u003cp\u003e\u003ccode\u003elocal-install-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e    |\n| `dist-dir`              | \u003cp\u003e\u003ccode\u003edist-dir\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e              |\n| `local-hpc-root`        | \u003cp\u003e\u003ccode\u003elocal-hpc-root\u003c/code\u003e value from \u003ccode\u003estack path\u003c/code\u003e\u003c/p\u003e        |\n\n## Installing Compiler Tools\n\nThe `compiler-tools` input can be used to install packages (with\n`--copy-compiler-tool`) as part of the _Dependencies_ step. The installed tools\ncan be used by other parts of the build via `stack exec`, such as to reformat\nand upload coverage:\n\n```yaml\n- id: stack\n  uses: freckle/stack-action@v5\n  with:\n    compiler-tools: hpc-lcov\n    stack-build-arguments: --coverage\n\n- run: stack --no-terminal exec -- hpc-lcov --file \"$HPC_ROOT\"/combined/all/all.tix\n  env:\n    HPC_ROOT: ${{ steps.stack.outputs.local-hpc-root }}\n\n- uses: codecov/codecov-action@v2\n  with:\n    files: ./lcov.info\n```\n\nDoing it this way, vs a separate `run: stack install...`, means the building of\nthese tools will be included in the dependencies cache.\n\n## Generating a Build Matrix of `stack.yaml`s\n\nThe following automatically discovers all files matching `stack*.yaml` and runs\nthis action with each of them:\n\n```yaml\njobs:\n  generate:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - id: generate\n        uses: freckle/stack-action/generate-matrix@v5\n    outputs:\n      stack-yamls: ${{ steps.generate.outputs.stack-yamls }}\n\n  test:\n    needs: generate\n    strategy:\n      matrix:\n        stack-yaml: ${{ fromJSON(needs.generate.outputs.stack-yamls) }}\n      fail-fast: false\n\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: freckle/stack-action@v5\n        with:\n          stack-arguments: --stack-yaml ${{ matrix.stack-yaml }}\n```\n\nSee [generate-matrix/action.yml](./generate-matrix/action.yml) for more details.\nThis has been available since version 4 of this action.\n\n## Release\n\nTo trigger a release (and update the `@v{major}` tag), merge a commit to `main`\nthat follows [Conventional Commits][]. In short,\n\n- `fix:` to trigger a patch release,\n- `feat:` for minor, and\n- `feat!:` and major\n\nWe don't enforce conventional commits generally (though you are free do so),\nit's only required if you want to trigger release.\n\n[conventional commits]: https://www.conventionalcommits.org/en/v1.0.0/#summary\n\n---\n\n[LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreckle%2Fstack-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreckle%2Fstack-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreckle%2Fstack-action/lists"}