This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
forked from IntersectMBO/cardano-node
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (104 loc) · 3.78 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
125
126
127
name: "Haddock documentation"
on:
push:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ghc: ["9.2.7"]
cabal: ["3.10.1.0"]
os: [ubuntu-latest]
env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2023-07-28"
# Modify this value to "invalidate" the secp cache.
SECP_CACHE_VERSION: "2022-12-30"
# current ref from: 27.02.2022
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
steps:
- name: Workaround runner image issue
if: runner.os == 'Linux'
# https://github.com/actions/runner-images/issues/7061
run: sudo chown -R $USER /usr/local/.ghcup
- name: Install Haskell
uses: input-output-hk/setup-haskell@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/checkout@v3
- name: Add build script path
run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH
- name: Install build environment
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
uses: input-output-hk/setup-secp256k1@v1
with:
git-ref: ${{ env.SECP256K1_REF }}
cache-version: ${{ env.SECP_CACHE_VERSION }}
- name: Cabal update
run: cabal update
- name: combine github-pages, and machine local project files.
run: |
cat .github/workflows/cabal.project.local.github-pages \
".github/workflows/cabal.project.local.ci.$(uname -s)" \
| tee cabal.project.local
- name: Dry run
run: |
cabal build all --dry-run
mkdir ./haddocks
DRY_RUN=1 ./scripts/haddocs.sh ./haddocks true
- name: Cabal cache over S3
uses: action-works/cabal-cache-s3@v1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
region: ${{ vars.BINARY_CACHE_REGION }}
dist-dir: dist-newstyle
store-path: ${{ steps.cabal-store.outputs.cabal-store }}
threads: ${{ vars.BINARY_CACHE_THREADS }}
archive-uri: ${{ vars.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }}
skip: "${{ vars.BINARY_CACHE_URI == '' }}"
- name: Cabal cache over HTTPS
uses: action-works/cabal-cache-s3@v1
with:
dist-dir: dist-newstyle
store-path: ${{ steps.cabal-store.outputs.cabal-store }}
threads: ${{ vars.BINARY_CACHE_THREADS }}
archive-uri: https://iohk.cache.haskellworks.io/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }}
skip: "${{ vars.BINARY_CACHE_URI != '' }}"
enable-save: false
- 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