-
Notifications
You must be signed in to change notification settings - Fork 23
124 lines (101 loc) · 3.65 KB
/
github-page.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: "Haddock documentation"
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7"]
os: [ubuntu-latest]
env:
# current ref from: 27.02.2022
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
steps:
- uses: actions/checkout@v1
- name: Set cache version
run: echo "CACHE_VERSION=UN37rUo" >> $GITHUB_ENV
- name: Add build script path
run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH
- uses: haskell/actions/setup@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 3.6.2.0
- name: Haskell versions
run: |
ghc --version
cabal --version
- name: Install build environment
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get -y install libsodium23 libsodium-dev
sudo apt-get -y install libsystemd0 libsystemd-dev
sudo apt-get -y remove --purge software-properties-common
sudo apt-get -y autoremove
- name: Install secp256k1 (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get -y install autoconf automake libtool
mkdir secp256k1-sources
cd secp256k1-sources
git clone https://github.com/bitcoin-core/secp256k1.git
cd secp256k1
git reset --hard $SECP256K1_REF
./autogen.sh
./configure --prefix=/usr --enable-module-schnorrsig --enable-experimental
make
make check
sudo make install
cd ../..
- name: Cabal update
run: cabal update
- name: Disable reorder goals on MacOS and Linux
# Avoid reorder goals for platforms that don't need it because re-order goals can take up to 10 minutes
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: |
cat cabal.project | sed 's|reorder-goals: True|reorder-goals: False|g' > cabal.project.tmp
mv cabal.project.tmp cabal.project
- name: Use cabal.project.local.github-pages
run: cp .github/workflows/cabal.project.local.github-pages cabal.project.local
- name: Dry run
run: |
cabal build all --dry-run
mkdir ./haddocks
DRY_RUN=1 ./scripts/haddocs.sh ./haddocks true
- name: Record dependencies
run: |
cat ${{ env.PLAN_JSON }} | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
- uses: actions/cache@v2
name: Cache cabal store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
restore-keys: |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-
- name: Install dependencies
run: cabal build all
- name: Build Haddock documentation 🔧
run: ./scripts/haddocs.sh ./haddocks true
- name: View HTML files
run: |
find "dist-newstyle/build" -name '*.html' | xargs grep html
- name: Upload documentation
uses: actions/upload-artifact@v2
if: ${{ always() }}
continue-on-error: true
with:
name: haddocks-${{ matrix.os }}-${{ matrix.ghc }}
path: ./haddocks
- name: Deploy documentation to gh-pages 🚀
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN || github.token }}
publish_dir: haddocks
force_orphan: true