Merge pull request #7793 from ptkato/init-dependency-test-fix
[cabal.git] / templates / ci-linux.template.yml
blob3f90db7fbe38fdef2605c7e107922d00d24964c2
1 # This file is auto-generated
3 # To regenerate it run
5 #     make github-actions
7 name: Linux
8 on:
9   push:
10     branches:
11       - master
12   pull_request:
13   release:
14     types:
15       - created
17 jobs:
18 {% for job in jobs %}
19   validate-{{ mangleVersion job.version }}{% if job.old %}-old{% endif %}:
20     name: validate.sh {%if job.old %}old GHCs{% else %}ghc-{{job.version}}{% endif %}
21     runs-on: ubuntu-18.04
22 {% for needs in job.needs %}
23     needs: validate-{{ mangleVersion needs }}
24 {% endfor %}
25     container:
26       image: phadej/ghc:{{job.version}}-{% if job.xenial %}xenial{% else %}bionic{% endif %}
27     steps:
28       - name: System info
29         run: |
30           uname -a
31       - name: Set PATH
32         # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
33         run: |
34           echo "$HOME/.cabal/bin" >> $GITHUB_PATH
35       - name: Install cabal-plan
36         run: |
37           mkdir -p $HOME/.cabal/bin
38           curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
39           echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc  cabal-plan.xz" | sha256sum -c -
40           xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
41           rm -f cabal-plan.xz
42           chmod a+x $HOME/.cabal/bin/cabal-plan
43 {% if or job.xenial job.old %}
44       - name: apt-get update
45         run: apt-get update
46 {% endif %}
47 {% if job.xenial %}
48       - name: Install dynamic libraries
49         run: apt-get install -y ghc-{{job.version}}-dyn
50 {% endif %}
51 {% if job.old %}
52       - name: Install extra compilers
53         run: apt-get install -y ghc-7.0.4-dyn ghc-7.2.2-dyn ghc-7.4.2-dyn
54 {% endif %}
55       - name: Update Hackage index
56         run: cabal v2-update
57       # https://github.com/actions/checkout/issues/170
58       # - uses: actions/checkout@v2
59       - name: Checkout
60         run: |
61           echo $GITHUB_REF $GITHUB_SHA
62           git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
63           git fetch origin $GITHUB_SHA:temporary-ci-branch
64           git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
65 {% for step in job.steps %}
66       - name: Validate {{step}}
67         run: sh validate.sh -j 2 -w ghc-{{job.version}} -v {{job.flags}} -s {{step}}
68 {% endfor %}
69 {% endfor %}