@@ -21,36 +21,41 @@ jobs:
21
21
SECP256K1_REF : ac83be33d0956faf6b7f61a60ab524ef7d6a473a
22
22
23
23
steps :
24
- - uses : actions/checkout@v1
24
+ # this seems to break something. It _must_ come after the pacman setup
25
+ # above. It appears as if PATHEXT is set _after_ ghcup install ghc/cabal, and
26
+ # as such we'd need pacman.exe instead.
27
+ - name : Setup Haskell
28
+ run : |
29
+ # Use GHCUP to manage ghc/cabal
30
+ ghcup install ghc --set ${{ matrix.ghc }}
31
+ ghcup install cabal --set 3.8.1.0
25
32
26
- - name : Set cache version
27
- run : echo "CACHE_VERSION=UN37rUo" >> $GITHUB_ENV
33
+ ghc -- version
34
+ cabal --version
28
35
29
- - name : Add build script path
30
- run : echo "$(pwd)/.github/bin" >> $GITHUB_PATH
36
+ - name : " Setup cabal-store"
37
+ id : cabal-store
38
+ shell : bash
39
+ run : |
40
+ cabal help user-config
41
+ cabal_config_file="$(cabal help user-config | grep -A 1 'You can edit the cabal configuration file to set defaults' | tail -n 1 | xargs)"
31
42
32
- - uses : haskell/actions/setup@v1
33
- id : setup-haskell
34
- with :
35
- ghc-version : ${{ matrix.ghc }}
36
- cabal-version : 3.6.2.0
43
+ echo "cabal-store=$(dirname "$cabal_config_file")/store" | tee -a "$GITHUB_OUTPUT"
37
44
38
- - name : Haskell versions
39
- run : |
40
- ghc --version
41
- cabal --version
45
+ - uses : actions/checkout@v2
46
+
47
+ - name : Add build script path
48
+ run : echo "$(pwd)/.github/bin" >> $GITHUB_PATH
42
49
43
50
- name : Install build environment
44
- if : matrix.os == 'ubuntu-latest'
45
51
run : |
46
52
sudo apt-get update
47
53
sudo apt-get -y install libsodium23 libsodium-dev
48
54
sudo apt-get -y install libsystemd0 libsystemd-dev
49
55
sudo apt-get -y remove --purge software-properties-common
50
56
sudo apt-get -y autoremove
51
57
52
- - name : " LINUX: Install secp256k1"
53
- if : runner.os != 'Windows'
58
+ - name : " Install secp256k1"
54
59
shell : bash
55
60
env :
56
61
CI_SECP_FLAGS : " --prefix=/usr"
60
65
- name : Cabal update
61
66
run : cabal update
62
67
63
- - name : Disable reorder goals on MacOS and Linux
64
- # Avoid reorder goals for platforms that don't need it because re-order goals can take up to 10 minutes
65
- if : matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
66
- run : |
67
- cat cabal.project | sed 's|reorder-goals: True|reorder-goals: False|g' > cabal.project.tmp
68
- mv cabal.project.tmp cabal.project
69
-
70
68
- name : combine github-pages, and machine local project files.
71
69
run : |
72
70
cat .github/workflows/cabal.project.local.github-pages \
@@ -79,18 +77,28 @@ jobs:
79
77
mkdir ./haddocks
80
78
DRY_RUN=1 ./scripts/haddocs.sh ./haddocks true
81
79
82
- - name : Record dependencies
83
- run : |
84
- cat ${{ env.PLAN_JSON }} | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
85
-
86
- - uses : actions/cache@v2
87
- name : Cache cabal store
80
+ - name : Cabal cache over S3
81
+ uses : action-works/cabal-cache-s3@v1
82
+ env :
83
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
84
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
85
+ with :
86
+ region : us-west-2
87
+ dist-dir : dist-newstyle
88
+ store-path : ${{ steps.cabal-store.outputs.cabal-store }}
89
+ threads : 16
90
+ archive-uri : ${{ secrets.BINARY_CACHE_URI }}
91
+ skip : " ${{ secrets.BINARY_CACHE_URI == '' }}"
92
+
93
+ - name : Cabal cache over HTTPS
94
+ uses : action-works/cabal-cache-s3@v1
88
95
with :
89
- path : ${{ steps.setup-haskell.outputs.cabal-store }}
90
- key : cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
91
- restore-keys : |
92
- cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
93
- cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-
96
+ dist-dir : dist-newstyle
97
+ store-path : ${{ steps.cabal-store.outputs.cabal-store }}
98
+ threads : 16
99
+ archive-uri : https://iohk.cache.haskellworks.io
100
+ skip : " ${{ secrets.BINARY_CACHE_URI != '' }}"
101
+ enable-save : false
94
102
95
103
- name : Install dependencies
96
104
run : cabal build all
0 commit comments