My CI cant find stack and I don't know why. I'm using the following .gitlab-ci.yml file for setting up gitlab-CI for a Haskell Stack project. I took it from this other question that claims it worked.
image: haskell:8.6.5
cache:
paths:
- .stack
- .stack-work
- target
test:
stage: test
script:
- ghc --version
- stack --system-ghc build
- stack test
However it fails and reports (full output below):
bash: line 96: ghc: command not found
ERROR: Job failed: exit status 1
Clearly, ghc is missing, but I though that came on the image haskell:8.6.5 doesn't it?
I have tried alternative images such as image: fpco/stack-build:lts-11.15 without any luck (reports bash: line 96: stack: command not found).
My best guess is that I'm missing a crucial step to make sure ghc and stack are on the image I'm using, but I can't figure out what it is. So, what am I missing?
Edit: full error output
Running with gitlab-runner 13.2.2 (a998cacd)
on karson: Ubuntu 20.04 LTS Shared q_B8_V-j
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on karson...
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
Initialized empty Git repository in /var/lib/gitlab-runner/builds/q_B8_V-j/0/fromager/cheesecloth/MicroRAM/.git/
Created fresh repository.
Checking out 4d7e065d as 39-continuous-integration...
Skipping Git submodules setup
Restoring cache
00:00
Checking cache for default...
Runtime platform arch=amd64 os=linux pid=4053876 revision=a998cacd version=13.2.2
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
Executing "step_script" stage of the job script
00:00
$ ghc --version
bash: line 96: ghc: command not found
ERROR: Job failed: exit status 1