zuul-jobs/roles/ensure-haskell-stack/tasks/main.yaml
Tristan Cacqueray cf64b73f78 haskell-stack-test: add haskell tool stack test
This change adds a new job to test stack based haskell project.

Change-Id: Ie3492097b351eec743d98e9ca8bc693c00c11a78
2020-05-01 15:35:33 +00:00

29 lines
679 B
YAML

- name: Make sure the role is run on Fedora
fail:
msg: "This role supports Fedora only"
when: "ansible_distribution != 'Fedora'"
- name: Check stack version
command: stack --version
failed_when: false
register: _stack_version
- block:
- name: Install stack copr
command: dnf copr enable -y petersen/stack2
become: true
- name: Install stack
package:
name: stack
state: present
become: true
- name: Upgrade stack
command: stack upgrade
become: true
- name: Setup stack LTS
command: "stack {% if lts_version %}--resolver {{ lts_version }}{% endif %} setup"
when: _stack_version.rc != 0